On Apr 30, 2008, at 7:53 AM, Madhu Gowda wrote:
Hi,
I am new to log4cxx.
I downloaded the log4cxx-0.9.7.tar.gz and built it on Visual Studio
2005.
I am trying a sample program given in the document that reads the
configuration from log4j.properties and logs the messages in given
log file.
my code is as follows:
PropertyConfigurator::configure(_T("log4j.properties"));
LoggerPtr rootLogger = Logger::getRootLogger();
rootLogger->debug("this is a DEBUG test message");
rootLogger->info("this is a INFO test message");
rootLogger->warn("this is a WARNING test message");
The log messages in log file are printed as junk values as:
2008-04-30 18:20:54,060 [5240] DEBUG root - - /0@ )0@
Á«€|ÖQ@
2008-04-30 18:20:54,060 [5240] INFO root - - /0@ )0@
Á«€|ÖQ@
2008-04-30 18:20:54,060 [5240] WARN root - - /0@ )0@
Á«€|ÖQ@
I think the problem is in conversion to log4cxx::string.
In my application I want to use std::string as the log messages
How do I convert std::string to log4cxx string..
Please, give some suggestions on how to fix this.
Regards,
Madhu Gowda
Use of log4cxx 0.9.7 is strongly discouraged, especially for new
code. Please use log4cxx 0.10.0, we will get you through your build
issues.