On 9 February 2012 08:40, Florian Semm <florian.semm@...> wrote:
> We have forgot the option 'logger' under 'rootLogger'. It is maybe better to
> trigger a notice 'you have called an unkown logger', than to return a logger
> with the configuration of the root-logger. To locate the error would be much
This is by design. Logger::getLogger() will construct a new logger and
place it in a hierarchy. Loggers in a hierarchy inherit settings from
their first ancestor. Your logger therefore inherited settings from
the root logger since no closer ancestor exists.
Imagine the following imaginary situation: Let's say you have a couple
of classes in your project, here's their qualified class names:
If each class has it's own Logger, and the Logger is named the same as
the qualified class name, then the loggers will be placed in the
hierarchy accordingly .
Now, if you have in your config file a configuration for a logger
named "myproject\database" then both DBReader and DBWriter (and any
other class in that part of the namespace) will inherit the
configuration from "myproject\database" since it's their first
Because of this we don't want to have warnings for loggers which are
not explicitly configured in the config file. We don't want to
configure every individual logger since there could be a lot of them.
We want implicit inheritance.
Franky, though, I have not used this functionality too much. Writing
better docs and real-world usage examples is on my todo list.
 Well this isn't strictly true at the moment, since backslash won't
be detected as a delimiter in version 2.2, only dots (Java style). So
you would have to name the loggers "myproject.database.DBReader", etc.
But in the next version backslash will also work, it was discussed on
the mailing list recently.