python loggingL filter limitation, looks intentional?

C

Chris Withers

Hi Vinay,

It looks like this was intentional, so why was it decided that filters
would only be passed messages logged to the logger they're attached to
rather than the all messages that end up getting passed to logger?

For example, an app and the libraries it uses log to 'some.db.driver',
'some.lib' and 'myapp'.

The root logger has a number of handlers attached to it.

I want to write a filter that adjusts, up or down, the level of certain
messages logged based on a regex match of their message.

If I understand correctly, I have to add my filter to all of the loggers
above, rather than just the root logger where my handlers live?

Or, alternatively, add the filter to all of the root handlers, thereby
making the configuration of those handlers and/or more dependent on each
other.

Why is that?

cheers,

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top