c++ - Why are duplicate messages being logged -


i'm new log4cplus. have following configuration:

log4cplus.rootlogger=trace, stdout   log4cplus.logger.zios.utl.thread=debug, stdout  log4cplus.appender.stdout=log4cplus::consoleappender log4cplus.appender.stdout.layout=log4cplus::patternlayout log4cplus.appender.stdout.layout.conversionpattern=%d{%h:%m:%s} [%t] - %m%n 

which load following code:

try {     log4cplus::propertyconfigurator::doconfigure("log4cplus.properties"); } catch (...) {     cout << "exception occured while opening log4cplus.properties" << endl; } 

it loads without incident whenever log something, 2 messages appearing in log. example, log using code:

logger log = logger::getinstance("zios.utl.thread"); log4cplus_debug(log, "thread created"); 

and appears in log is:

17:10:48 [3075459952] - thread created 17:10:48 [3075459952] - thread created 

any idea why happening?

you have 1 appender , use twice, 2 loggers:

log4cplus.rootlogger=trace, stdout  log4cplus.logger.zios.utl.thread=debug, stdout 

this means appender attached root logger , zios.utl.thread logger.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -