I am creating a parser and I want to output the Debug and the WARN messages to different files.
The code is very straightforward:
logger(log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("TParser")));
LOG4CPLUS_WARN/DEBUG(logger, "XYZ");
I tried to use the following configuration file
log4cplus.logger.TParser=DEBUG, TD
log4cplus.appender.TD=log4cplus::RollingFileAppender
log4cplus.appender.TD.MaxFileSize=5MB
log4cplus.appender.TD.MaxBackupIndex=5
log4cplus.appender.TD.layout=log4cplus::TTCCLayout
log4cplus.appender.TD.File=debug.log
log4cplus.logger.TParser=WARN, TW
log4cplus.appender.TW=log4cplus::RollingFileAppender
log4cplus.appender.TW.MaxFileSize=5MB
log4cplus.appender.TW.MaxBackupIndex=5
log4cplus.appender.TW.layout=log4cplus::TTCCLayout
log4cplus.appender.TW.File=trace.log
But the Debug is not bei logger(log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("TksParser")))ng generated... if I remove the [ log4cplus.logger.TParser=WARN, TW ] and the lines after that it generates the debug.
I also don't want to output the data to the console. I'm having some hard time triyng to learn how to use, but there is not a lot of content about log4cplus