You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by snake0zero <sn...@hotmail.com> on 2014/11/14 11:06:41 UTC

about another logger of log4j only can be loaded after org.ops4j.pax.logging.cfg is refreshed in Servicemix 5.x

Hi I need to define another logger to output some special log for specified
file.

So i added some configuration at end of etc/org.ops4j.pax.logging.cfg as
below:

# Security logger
log4j.logger.cbpsecurity=INFO, security
log4j.additivity.cbpsecurity = false
log4j.appender.security=org.apache.log4j.RollingFileAppender
log4j.appender.security.file=${cbp.security}/security/security.log
log4j.appender.security.maxFileSize=5MB
log4j.appender.security.maxBackupIndex=10
log4j.appender.security.layout=org.apache.log4j.PatternLayout
log4j.appender.security.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss}
%-5p %m%n

and in my bundle,  i just define logger as below
private static final Logger Log = Logger.getLogger("cbpsecurity");

So, my problem is that, when i started servicemix i found security.log is
created,
afterward no matter how i executed the log operation, security.log is still
empty.
But it works if i refresh etc/org.ops4j.pax.logging.cfg file, just like edit
some words then undo and save.
it seems some default log config cache in servicemix and need to reload
customized part.

is it a servicemix 5.x issue or does it need to another configuration?

your response is really appreicated

Thx and Best regards  

Joseph



--
View this message in context: http://servicemix.396122.n5.nabble.com/about-another-logger-of-log4j-only-can-be-loaded-after-org-ops4j-pax-logging-cfg-is-refreshed-in-Serx-tp5721853.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.