Shawn Boyce wrote:
> OK. I agree with you in the simple case of a single Logger. The container
> creates and configures it based on a config file, and then passes it to the
> component.
>
> Let me explain more about what's going on. It has to do with child loggers.
> I have a Service component which is passed a Logger via enableLogging.
> It then creates several child loggers (using the getChildLogger). From
> the configuration
> in its context, it then sets the children's logger priorities. So they
> are not hardcoded.
>
> The child loggers show different functional areas of the service's
> operation and so allow
> the user to turn on debugging/logging information in these areas.
>
> Why doesn't the container set the priorities? Well it does not know about
> the child loggers since they are controlled by the Service.
The LoggerManager is able to get the specific logger with the specific
category you want. It also allows you to control the priorities of the
child loggers centrally--in one config file.
You can pass a reference to the LoggerManager in the Context that you
can pass from a parent container to a child container. This, in the
end is much cleaner than what you are proposing.
--
"They that give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety."
- Benjamin Franklin
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>