I’m new to Java but I thought I understood the logging concepts. From what I read, the TRACE level logging was enabled in v1.1 of commons-logging and 1.2.12 of log4j.
I’m using the following jars: commons-logging-api-1.1.jar & log4j-1.2.15.jar.
The code is:
if ( log.isTraceEnabled() ) {
log.trace("some text");
}
However, it’s emitting when my log4j.properties setting is DEBUG and the output is tagged as “DEBUG”.
Is there something obvious that I’m doing wrong?
Traceis finer grained thandebug. That explains why you are seeing trace statements when the setting is for debug (or finer). As for why it is taggeddebug— commons logging is responsible for that. See http://old.nabble.com/Re%3A-TRACE-vs-DEBUG-p4146626.html.