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

Try

FileAppender fa = new FileAppender();
fa.setFile("xyz");
fa.setLayout(new PatternLayout());
fa.setEncoding(yourEncoding);
.. set other options
fa.activateOptions();

Hope this helps,

At 03:50 07.01.2003 +0100, you wrote:
>Hello,
>
>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
>bufferedIO,
>                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.
>
>
>Cheers,
>
>Thierry.

--
Ceki



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


Mime
View raw message