logging: handle everything EXCEPT certain loggers

Gábor Farkas gabor.farkas at gmail.com
Mon Nov 7 07:53:05 EST 2011


hi,

is there a way to setup log-handlers in a way that they log logs from
every logger, exept certain ones?

basically i want the handler to handle everything, except log-records
that were generated by loggers from "something.*"
can this be done?

i tried to create filters, but the log-record does not have access to
his logger, so i cannot filter based on it's "path".

right now the only idea i have is to setup a filter for the
"something.*" path, have it mark somehow the log-records,
and then create a filter on the global level, that will drop such
log-records. is there a simpler solution?

thanks,
gabor



More information about the Python-list mailing list