On Dec 9, 2008, at 2:44 PM, peter.doornbosch wrote:
Hi,
log4cxx::LoggerPtr
tmpLogger( log4cxx::Logger::getLogger("SIM.TEST") );
// set logger level
tmpLogger->setLevel( log4cxx::Level::getDebug() );
// set appender properties
===> log4cxx::PatternLayoutPtr layout( new
log4cxx::PatternLayout( "%d %-5p [%l] [%c:%M] %m%n" ) );
try this: new log4cxx::PatternLayout( L"%d %-5p [%l] [%c:%M] %m%n" )
(yes, that is an "L" before the quotes ;-)
or switch your project to unicode.
=> i think the problem is that the pattern is interpreted as being
of type char*, but the PatternLayout constructor expects unicode.
hth
peter
Use LOG4CXX_STR() which takes an ASCII literal and prepends the
appropriate qualifier (L or nothing) depending on configuration.
log4cxx::PatternLayoutPtr layout( new
log4cxx::PatternLayout(LOG4CXX_STR( "%d %-5p [%l] [%c:%M] %m%n" )) );
Anytime an argument takes a LogString or a logchar*, you should use
LOG4CXX_STR() in the same manner you'd use _T() for TCHAR*.