Note that there are some explanatory texts on larger screens.

plurals
  1. POlog4j interference - level keeps being set to "OFF"
    primarykey
    data
    text
    <p>I'm trying to set up log4j in my app and one of my third party JARs seems to somehow keep turning my log level to "OFF". It only happens when code from that library is executed. I don't know how it can do this because I'm not using a logger it knows the name of, and I'm not using the root logger. I've spent 5 hours on this and so far my only achievement has been to acquire a frustration level of over 9000.</p> <p>I'm using the latest Tomcat (7.0.37) on windows 7 64 bit, Java 6 u23.</p> <p>log4j.properties:</p> <pre><code>log4j.logger.com.foo.bar.SearchAndReport=TRACE, stdout, file log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appender.file.File=D:/logTest.log log4j.appender.file.MaxFileSize=100KB log4j.appender.file.MaxBackupIndex=1 log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=[%p] %d{dd MMM yyyy HH:mm:ss,SSS} - %C{2}.%M() - %m %n </code></pre> <p>then in my Servlet for testing I have:</p> <pre><code>Logger log = Logger.getLogger(SearchAndReport.class); System.out.println(log.getLevel()); </code></pre> <p>This code runs every time a DoPost or DoGet is run, and the level stays on the level I set (TRACE) until the third party code runs and turns it to off.</p> <p>My questions are:</p> <ol> <li>How can another logger interfere with a logger I've named and set up myself?</li> <li>How can I stop this happening, and force the level I set?</li> </ol> <p>Thanks :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload