DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15942>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15942

Can't specify encoding to ConsoleAppender

           Summary: Can't specify encoding to ConsoleAppender
           Product: Log4j
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Appender
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Although ConsoleAppender extends the WriterAppender, it does not follow
the rule of character encoding.  Given the source code of
ConsoleAppender: (of constructor and method activateOptions)

    if(target.equals(SYSTEM_OUT)) {
      setWriter(new OutputStreamWriter(System.out));
    } else {
      setWriter(new OutputStreamWriter(System.err));
    }

If I want to output characters other than the system default character
set, the ConsoleAppender outputs "?".  Is it better modify the code as
below?

    if(target.equals(SYSTEM_OUT)) {
      setWriter(createWriter(System.out));
    } else {
      setWriter(createWriter(System.err));
    }

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to