Purpose of setting debug="false" in log4j at configuration level

29 Views Asked by At

What is the purpose of setting attributes at configuration level in log4j.xml?

<log4j:configuration 
    xmlns:log4j="http://jakarta.apache.org/log4j/"
    debug="false" threshold="info">
1

There are 1 best solutions below

0
Ceki On

In log4j 1.x as well as logback, the debug="true" instruction enables the display of messages internal to the logging library. In log4j 1.x and logback, the internal messages are independent of logging and loggers. It follows that the debug="true" instruction is unrelated to setting levels on loggers.

In logback, these internal messages are called status messages. See also the "shorthand" section a few paragraphs below.

In log4j 2.x, the internal messages followed a different logic but was simplified in version 2.9 and later.