You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Crook, Laura" <LC...@Kronos.com> on 2006/02/01 22:05:26 UTC

Logging unicode characters with log4j

I am attempting to set our logs up so that they will save Chinese
characters properly, and I'm not having much luck.  We have a class
which extends FileAppender, and in it I'm doing a brute-force
appender.setEncoding("UTF-16"), but unfortunately I'm still seeing
question marks in the log file.

 

Can anyone tell me what I need to do to make this work?  


Re: Logging unicode characters with log4j

Posted by Curt Arnold <ca...@apache.org>.
On Feb 1, 2006, at 3:05 PM, Crook, Laura wrote:

> I am attempting to set our logs up so that they will save Chinese
> characters properly, and I'm not having much luck.  We have a class
> which extends FileAppender, and in it I'm doing a brute-force
> appender.setEncoding("UTF-16"), but unfortunately I'm still seeing
> question marks in the log file.
>
>
>
> Can anyone tell me what I need to do to make this work?
>

Please confirm that the problem still occurs with the latest release  
of log4j.  I recall some encoding related bugs that were fixed prior  
to 1.2.12, but can't locate the exact bug reports.

Could you tell us the platform, JDK, and version of log4j you are using?

Can you open the log file with a hex editor?  Does it appear to be a  
double byte file, that is every other byte is 00 in stretches of  
English text.

Does the problem occur when FileAppender is used or only when using  
your extension of FileAppender?




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org