Python2.3 logging utilities

Gerhard Häring gh at
Thu Jul 17 17:12:13 CEST 2003

Samir Patel wrote:
> First of all, hats of on logging module in python 2.3.
> Very elegant...
> I have 2 questions regarding Handler class in logging:
> [...]
> 2. SMTPHandler: Is there any way to send an email
> where server requires authentication through
> logconfig.ini file. I send an email message to myself
> through logging and SMTPHandler and it works perfect,
> but if I want to send an email to external email
> address, I can't do it because replying is not allow.
> I can do it this in a python program by using ehlo and
> docmd of smtplib object, 

There's no need for such low-level hacks. SMTP AUTH is accessible 
through the login() method of SMTP objects.

> but how can I do same thing
> in loggers' config.ini file.

You can't, currently. You're welcome to submit a patch that provides 
this feature, though :) From a quick glance it should be quite easy to 
implement. While at it, it would make sense to be able to use a 
nonstandard SMTP port as well :)

-- Gerhard

More information about the Python-list mailing list