logging: handle everything EXCEPT certain loggers

Discussion in 'Python' started by Gábor Farkas, Nov 7, 2011.

  1. 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
     
    Gábor Farkas, Nov 7, 2011
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Shannon

    Logging with multiple loggers/handlers

    Jeff Shannon, Jul 6, 2004, in forum: Python
    Replies:
    3
    Views:
    343
    Jeff Shannon
    Aug 7, 2004
  2. John Salerno
    Replies:
    20
    Views:
    861
    John Salerno
    Aug 11, 2006
  3. Robert
    Replies:
    0
    Views:
    438
    Robert
    Aug 30, 2007
  4. temp00
    Replies:
    0
    Views:
    433
    temp00
    Jun 25, 2008
  5. Rhino
    Replies:
    8
    Views:
    520
    markspace
    Apr 30, 2010
Loading...

Share This Page