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 Kim Jongtae <de...@bora.dacom.co.kr> on 2001/02/27 08:46:23 UTC

How to use Writer object instead of OutputString , when using log4j?

Hi all.

My language is Korean.
 I want to log Korean  messages using log4j. But in order that I logging any Korean messages  properly, 
I must convert the messages into 8859-1 charset , because log4j uses internally OutputStream, which
converts characters into bytes according a specified encoding and writes them to a byte-output stream.

when I use character streams , for examples Writer or Reader , there is no conversion so I can log in 
my language. 

How do I make the log4j using character stream class ? 
Is there class or method?  sample java source or modification for properties?

If you give me, I will thank for you



Bye.




Re: How to use Writer object instead of OutputString , when using log4j?

Posted by Ceki Gülcü <cg...@qos.ch>.
Kim,

Ander's response is correct. At least that is my working assumption. If for any reason writing Korean messages does not work for you, please describe the problem with additional details. We will do the necessary changes until it works flawlessly for you as this is a high priority item. Regards, Ceki


At 11:25 02.03.2001 +0100, Anders Kristensen wrote:
>The log4j "core" doesn't use output streams nor writers, individual
>appenders do. I believe the appenders which ship as part of log4j does
>indeed use Writers and not OutputStream. This is true, for example, for
>FileAppender. Ultimately, however, characters are written using your
>platforms default character encoding. If your platforms default encoding
>was, say, UTF-8, then korean log messages written to a FileAppender
>should appear as korean in UTF-8 encoded log files.
>
>Anders
>
>
>Kim Jongtae wrote:
>> 
>> Hi all.
>> 
>> My language is Korean.
>>  I want to log Korean  messages using log4j. But in order that I
>> logging any Korean messages  properly,
>> I must convert the messages into 8859-1 charset , because log4j uses
>> internally OutputStream, which
>> converts characters into bytes according a specified encoding and
>> writes them to a byte-output stream.
>> 
>> when I use character streams , for examples Writer or Reader , there
>> is no conversion so I can log in
>> my language.
>> 
>> How do I make the log4j using character stream class ?
>> Is there class or method?  sample java source or modification for
>> properties?
>> 
>> If you give me, I will thank for you
>> 
>> 
>> 
>> Bye.
>> 
>> 
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org

----
Ceki Gülcü          Web:   http://qos.ch      
av. de Rumine 5     email: cgu@qos.ch (preferred)
CH-1005 Lausanne           ceki_gulcu@yahoo.com
Switzerland         Tel: ++41 21 351 23 15


Re: How to use Writer object instead of OutputString , when using log4j?

Posted by Anders Kristensen <ak...@dynamicsoft.com>.
The log4j "core" doesn't use output streams nor writers, individual
appenders do. I believe the appenders which ship as part of log4j does
indeed use Writers and not OutputStream. This is true, for example, for
FileAppender. Ultimately, however, characters are written using your
platforms default character encoding. If your platforms default encoding
was, say, UTF-8, then korean log messages written to a FileAppender
should appear as korean in UTF-8 encoded log files.

Anders


Kim Jongtae wrote:
> 
> Hi all.
> 
> My language is Korean.
>  I want to log Korean  messages using log4j. But in order that I
> logging any Korean messages  properly,
> I must convert the messages into 8859-1 charset , because log4j uses
> internally OutputStream, which
> converts characters into bytes according a specified encoding and
> writes them to a byte-output stream.
> 
> when I use character streams , for examples Writer or Reader , there
> is no conversion so I can log in
> my language.
> 
> How do I make the log4j using character stream class ?
> Is there class or method?  sample java source or modification for
> properties?
> 
> If you give me, I will thank for you
> 
> 
> 
> Bye.
> 
> 
>