Hello T Master,

  thank you for comments.

On Mon, 25 Mar 2002 09:31:48 -0700
"T Master" <[EMAIL PROTECTED]> wrote:

> 
> 
> Log the output to a file.....  then open the file in an editor supporting UTF-8
> chars e.g. IE browser.
> Your console doesn't support UTF-8 characters, hence you see "????".

  No, it seems that problem is not in console. I modified code to use FileAppender and 
still get "?????" in output file. Please look at it, maybe I missed something obvious.

> 
> log4jv1.2  is beta now.  beta 5 I believe.  Not alpha.
> 

  Yes, thank you for pointing. It is really not-first beta. I will look if it is 
possible to use 1.2 without modification of code.

  Bye!

--
Oleg


  Updated code for testing "?????":

$ cat test.java
import org.apache.log4j.Category;
import org.apache.log4j.PropertyConfigurator;


public class test {
  static Category logger = Category.getInstance(test.class);
  static void main (String[] args) throws Throwable {
    String str = new String("\u65e5\u672c\u8a9e\u6587\u5b57\u5217");
    PropertyConfigurator.configure("log4j.opt");
    logger.debug(str);
  }
}

$ cat log4j.opt
log4j.rootCategory=debug, A
log4j.appender.A=org.apache.log4j.FileAppender
log4j.appender.A.File=test.log
log4j.appender.A.Append=false
log4j.appender.A.layout=org.apache.log4j.PatternLayout

$ javac test.java 
$ java -Dfile.encoding=UTF8 test
$ cat test.log
??????
$ od -a test.log 
0000000   ?   ?   ?   ?   ?   ?  nl
0000007
$ od -b test.log 
0000000 077 077 077 077 077 077 012
0000007
$

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

Reply via email to