logging module, multiple handlers

Discussion in 'Python' started by bneron@gmail.com, Mar 29, 2006.

  1. Guest

    hello,

    I use the logging module include in Python 2.4 distribution, and I 'd
    like to have a logger witth several Handlers .
    I know how to do this by coding in python, but could I specify this
    directly in the logger configuration file?

    Thanks in advance!

    bertrand
    , Mar 29, 2006
    #1
    1. Advertising

  2. Vinay Sajip Guest

    wrote:

    > I use the logging module include in Python 2.4 distribution, and I 'd
    > like to have a logger witth several Handlers .
    > I know how to do this by coding in python, but could I specify this
    > directly in the logger configuration file?


    See in

    http://docs.python.org/lib/logging-config-fileformat.html

    the text which says,

    "The handlers entry is a comma-separated list of handler names, which
    must appear in the [handlers] section. These names must appear in the
    [handlers] section and have corresponding sections in the configuration
    file."

    So...add multiple handler names in the "handlers" entry for a logger to
    get those handlers added to the logger.
    Vinay Sajip, Mar 29, 2006
    #2
    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. Andreas Jung
    Replies:
    3
    Views:
    319
    Neil Padgen
    Oct 28, 2003
  2. Jeff Shannon

    Logging with multiple loggers/handlers

    Jeff Shannon, Jul 6, 2004, in forum: Python
    Replies:
    3
    Views:
    341
    Jeff Shannon
    Aug 7, 2004
  3. Christoph Haas
    Replies:
    0
    Views:
    440
    Christoph Haas
    Jun 12, 2006
  4. Christoph Haas
    Replies:
    1
    Views:
    449
    Vinay Sajip
    Jun 14, 2006
  5. Michele Simionato

    logging module: removing handlers

    Michele Simionato, Nov 21, 2007, in forum: Python
    Replies:
    4
    Views:
    276
    Michele Simionato
    Nov 21, 2007
Loading...

Share This Page