Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #19039

python loggingL filter limitation, looks intentional?

Date 2012-01-16 13:10 +0000
From Chris Withers <chris@simplistix.co.uk>
Subject python loggingL filter limitation, looks intentional?
Newsgroups comp.lang.python
Message-ID <mailman.4793.1326719422.27778.python-list@python.org> (permalink)

Show all headers | View raw


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

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
             - http://www.simplistix.co.uk

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

python loggingL filter limitation, looks intentional? Chris Withers <chris@simplistix.co.uk> - 2012-01-16 13:10 +0000

csiph-web