You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by WJCarpenter <bi...@carpenter.org> on 2002/09/24 21:23:50 UTC

performance with NO configuration

I was startled to find this out, though it seems consistent with the
documentation.  Is this as expected?

If you run an instrumented application with no log4j configuration at
all, the default configuration sets the RootLogger to DEBUG.  Since
there are no appenders, there is a warning about that and, of course,
no logged output.

The problem is that setting the RootLogger to DEBUG cascades to set all
the other loggers to DEBUG.  Even though there are no appenders, the
value of logger.isDebugEnabled is true.  Lots of people follow the coding
pattern of wrapping complex things inside a check for whether some
particular level is enabled.  That's supposed to give the best performance.
If an application naively has no log4j.properties or equivalent, thinking
they'll get the best performance by completely disabling logging (or
maybe they don't even know anything about log4j inside some component
they're using), they'll actually get somewhat degraded performance.

Since this whole business only happens in the fallback of fallbacks (ie,
when there is no config info), what is the point of setting the RootLogger
to DEBUG?  Why not set it to ERROR or something to facilitate the
recommended coding pattern?




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>