java ee - How to disable log4j in web applications (turn off WARN messages) -
in short: how can configure log4j logger in third-party jar used in web application stops writing out warnings like
log4j:warn no appenders found logger (org.apache.activemq.transport.wireformatnegotiator). log4j:warn please initialize log4j system properly. and prevents clean shutdown throwing errors like
exception in thread "inactivitymonitor writecheck" java.lang.nullpointerexception exception in thread "inactivitymonitor readcheck" @ java.util.timerthread.run(unknown source) java.lang.nullpointerexception the details:
i writing tomcat web application shall use apache activemq. aside activemq-all-5.5.1.jar had put following libraries on class path rid of classpath issues:
- log4j-1.2.15.jar
- slf4j-api-1.5.11.jar
- slf4j-log4j12-1.5.11.jar
now application starts printing warnings 1 above. there a link on apache activemq web site, unfortunately it’s broken, , log4j wiki offline.
i tried create file named log4j.xml described here , put in web-inf/ directory (where expect belong) tried put in “default package” source code (i.e. web-inf/classes/). tried same adding xml headers file saw here. none of them works in either location. read elsewhere 1 has pass location passing -dlog4j.configuration= parameter jvm, cannot used in web application context. log4j web application tutorial shows how configure using web.xml, requires library contain class extends httpservlet. guess there isn’t such class in active mq, , if, how find it?
perhaps barking totally wrong tree , not have configure log4j itself, instead slf4j silently configure log4j me?
which simple way cleanly swich off logger long don’t need it?
the way rid of message set log4j config correctly. create log4j.properties file , place under web-inf/classes described here.
Comments
Post a Comment