[logback-dev] Better introspection into logging setup

Durchholz, Joachim Joachim.Durchholz at hennig-fahrzeugteile.de
Mon Mar 1 19:09:36 CET 2010


> JCL loggers don't have configuration - JCL, like SLF4J, is a 
> facade, not an implementation.

Ah, I wasn't aware of that. (This does not change the matter, but I
might be able to get better at avoiding misleading terminology.)

I'm using logback as the logging backend, that's why I'm using logback
and SLF4J interchangeably when it comes to configuration. Of course that
assumption doesn't transfer to all other projects, and certainly not to
SLF4J in general, so that's another source of confusion. Sorry for that.

With "SLF4J configuration", I mean whatever configuration the logging
backend uses.
It is even "the SLF4J configuration" in a broader sense: you can query
SLF4J about its properties. It's just a subset of these properties,
namely the logging level of each individual logger, and you need to know
the logger's name in advance, but it's a queryable configuration all
right.


Now that terminology is hopefully cleared up a bit, here's what I want
to achieve:

Right now, the JUL bridge docs tell me to install a Level.ALL JUL root
handler and let SLF4J sort out which messages are actually needed.
The docs rightfully warn that that can have a performance impact. Very
rightfully so actually.

So for each logger that's configured for SLF4J, I want to create a JUL
logger with the same logging level as its SLF4J counterpart. This should
drastically cut down on the number of log messages created and thrown
away.

I hope this is getting a bit clearer now :)

Regards (and thanks for your patience),
Jo


More information about the logback-dev mailing list