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. Advertisements

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:
    782
    Ken Varn
    Jun 22, 2005
  2. Replies:
    3
    Views:
    710
    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:
    957
    Pierre Fortin
    Sep 18, 2004
  4. rh0dium
    Replies:
    2
    Views:
    426
    rh0dium
    Aug 4, 2005
  5. Frank Aune
    Replies:
    4
    Views:
    1,314
    Vinay Sajip
    Oct 19, 2007
  6. Gal Aviel
    Replies:
    1
    Views:
    576
    Gerard Flanagan
    Mar 4, 2008
  7. er
    Replies:
    2
    Views:
    766
  8. Andrew Tomazos
    Replies:
    5
    Views:
    928
Loading...