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


Groups > comp.lang.python > #19039 > unrolled thread

python loggingL filter limitation, looks intentional?

Started byChris Withers <chris@simplistix.co.uk>
First post2012-01-16 13:10 +0000
Last post2012-01-16 13:10 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

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

#19039 — python loggingL filter limitation, looks intentional?

FromChris Withers <chris@simplistix.co.uk>
Date2012-01-16 13:10 +0000
Subjectpython loggingL filter limitation, looks intentional?
Message-ID<mailman.4793.1326719422.27778.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web