logging module: passing more args to the smtp handler?

Discussion in 'Python' started by Andreas Jung, Sep 1, 2003.

  1. Andreas Jung

    Andreas Jung Guest

    I have something like

    try:
    do_something_evil()
    except:
    reason = '....'
    mylogger.critical('error with', exc_info=sys.exc_info())

    my logginer.ini contains:

    [handler_smtp]
    ....
    level=CRITICAL
    args=('localhost', '', 'my subject')

    Is there a way to pass the 'reason' var to the Logger in order
    to be emitted as body of the mail?

    -aj
    Andreas Jung, Sep 1, 2003
    #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. Ken Varn
    Replies:
    2
    Views:
    623
    Ken Varn
    Jun 22, 2005
  2. Replies:
    3
    Views:
    489
    David Eppstein
    Sep 17, 2003
  3. Pierre Fortin

    args v. *args passed to: os.path.join()

    Pierre Fortin, Sep 18, 2004, in forum: Python
    Replies:
    2
    Views:
    685
    Pierre Fortin
    Sep 18, 2004
  4. Gal Aviel
    Replies:
    1
    Views:
    452
    Gerard Flanagan
    Mar 4, 2008
  5. er
    Replies:
    2
    Views:
    501
Loading...

Share This Page