logging module: passing more args to the smtp handler?

A

Andreas Jung

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', '(e-mail address removed)', '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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top