logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject Re: i18n & FileAppender...
Date Tue, 07 Jan 2003 04:21:36 GMT


FileAppender fa = new FileAppender();
fa.setLayout(new PatternLayout());
.. set other options

Hope this helps,

At 03:50 07.01.2003 +0100, you wrote:
>It looks like the FileAppender currently limits its ouput to the default
>system file encoding. This is when you are trying to debug a program using
>Japanese data on a US system, as all Japanese characters are reduced to
>question marks [?] :(. This is an unecessary restriction.
>Calling WriterAppender.setEncoding() method has no effect on the behavior of
>the FileAppender since the OutputStreamWriter has already been created when
>at construction time.
>A temporary solution if I may suggest one would be to add one constructor to
>the FileAppender that would take an extra encoding argument e.g:
>public FileAppender(Layout layout, String filename, boolean append, boolean
>                int bufferSize, String encoding) throws IOException {
>     this.layout = layout;
>     this.setEncoding(encoding);
>     this.setFile(filename, append, bufferedIO, bufferSize);
>That would enable user to have log file in any encoding they chose to.


To unsubscribe, e-mail:   <mailto:log4j-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-dev-help@jakarta.apache.org>

View raw message