python - Disable logging for a particular package -


I am implementing Python logging in my application, and I want to take advantage of the "default" root settings. I want to use root settings because I do not want to define a copy per module in a config file.

When I turn on DEBUG level logging for the root logger, then I'm running into a problem with the QPID Python Client API. My log files flooded the qpid debug statement:

2011-03-16 09: 16: 18,664 - qpid.messaging.io.ops - DEBUG - SENT [8de6b2c]: .. < / P>

2011-03-16 09: 16: 18667 - qpid.messaging.io.raw - DEBUG - ..

2011-03-16 09: 16: 18668 - qpid.messaging Io.raw - DEBUG - READ [8de6b2c]: ..

2011-03-16 09: 16: 18668 - qpid.messaging.io.ops - DEBUG - ..

ATC ..

Then there are two main questions:

1) Is it possible to login * just for your module without defining a module per logger? In other words, there is a way to share "logger settings", so is there a way to define logger-section instead of defining the logger instead of defining the logger?

Something like this: <2) Or how can I exclude qpid package logging through a config file? Msgstr "log-in files:

  [loggers] keys = root [handlers] keys = Kansolhandlr, Failhaandlr, Nlhandlr [Formetrs] key = Srlformr [Logr_rot] level = debug handlers = ConsoleHandler, fileHandler [handler_consoleHandler] class = StreamHandler level = debug formatter = simpleFormatter args = (sys.stdout,) [handler_fileHandler] class = logging.handlers.RotatingFileHandler level = debug formatter = simpleFormatter args = ( 'out. ) = root, A, B, C, A, B, C, D [Operators] key = consoleHandler, fileHandler, nullHandler [formatters] key = simpleForm atter [logger_root] level = error handlers = nullHandler [logger_a] level = debug handlers = consoleHandler, fileHandler [logger_b] level = debug handlers = consoleHandler, fileHandler [logger_c] level = debug handlers = consoleHandler, fileHandler   

Code E> [logger_qpid] level = NOTSET operators = nullHandler qualname = Qpid promotion = 0

Comments