Logging to different addressees

McA andreas.mock at web.de
Tue Jul 15 18:17:47 CEST 2008


Hi Vinary,

thank you for answering. I start be proud that the author of
the logging package himself is answering.  :-)

On 15 Jul., 15:51, Vinay Sajip <vinay_sa... at yahoo.co.uk> wrote:
> On Jul 15, 1:27 pm, McA <andreas.m... at web.de> wrote:
>
>
>
>
> Add a handler to the root logger (or common_logger) to send to the
> admin sink.

That's clear.

> Add a handler to certain_logger to send to the addressee sink.

That's also clear.

> If you added the admin sink handler to the root logger, you're done.

Isn't that the first thing above? What do you mean?

> Otherwise, you need to ensure that certain_logger is a child of
> common_logger.

What I want to code is something like that.
a) I know thet this is a message for the admin only:
admin_logger.log('blabla')  (admin_logger = root_logger =
logging.get_logger(""))

b) certain_logger.log('something'  => log to the root/admin/-sink as
well as to the
certain-sink.

Do I have to create a logger subclass where I do the multiplexing of
the logging messages?
I'm pretty sure I miss something. ;-)

>
> Regards,
>
> Vinay Sajip

Regards
Andreas Mock




More information about the Python-list mailing list