Hi all.

  I was trying to create unicode logs and messed with it for whole
  night.

  As it turned out, there is no setOption method in WriterAppender, so
  it was impossible to get Unicode output just with using
  PropertyConfigurator. And what is more, doing setEncoding after
  reading config is useless too - file is already created just after
  .configure
  
  So here is my patch for it:

Index: include/log4cxx/writerappender.h
===================================================================
RCS file: /home/cvspublic/logging-log4cxx/include/log4cxx/writerappender.h,v
retrieving revision 1.18
diff -r1.18 writerappender.h
160a161
>                               void setOption(const LogString& option, const 
> LogString& value);
Index: src/writerappender.cpp
===================================================================
RCS file: /home/cvspublic/logging-log4cxx/src/writerappender.cpp,v
retrieving revision 1.16
diff -r1.16 writerappender.cpp
229a230,241
> 
> void WriterAppender::setOption(const LogString& option, const LogString& 
> value)
> {
>       if(StringHelper::equalsIgnoreCase(option, LOG4CXX_STR("ENCODING"), 
> LOG4CXX_STR("encoding")))
>       {
>               setEncoding(value);
>       }
>       else
>       {
>               AppenderSkeleton::setOption(option, value);
>       }
> }
  

-- 
 Slava Tutushkin, http://aloner.ru
 mailto:[EMAIL PROTECTED]
 ICQ: 55463183

Reply via email to