>oggers are hierarchical.
When you declare a logger for ...
final static Logger logger = Logger.getLogger(com.acme.project.MyClass.class.getName());
You are asking for a logger on ...
- / (root)
- com
- acme
- project
- MyClass <-- this leaf
- MyOtherClass
- utils
- common
The logging configuration you give is for that specific logger and all children.
So if you obtain a logger at say "com.acme" via Logger.getLogger("com.acme")
and then setup an appender on that logger then all events that belong within "com.acme.*" get that configuration.
Such as from com.acme.common.CoreBehaviors, and com.acme.project.MyOtherClass, and com.acme.project.utils.UtilityLib, etc...
But not from org.eclipse.jetty.*
You can put the logging configuration anywhere in this hierarchy that best suits you.
log4j is quite capable, but doesn't have some advanced features that other slf4j implementation offer.
Such as SiftingAppenders (which will pick details from the logging event, its NDC, and its MDC to route logging events).
Or Discriminators that allow you to associate Appenders to details in the logging event (or its NDC, or its MDC).
Thanks very much for the explanation Joakim, now I understood how it works :)