Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Python2.3 logging utilities

31 views
Skip to first unread message

Samir Patel

unread,
Jul 17, 2003, 10:20:15 AM7/17/03
to
First of all, hats of on logging module in python 2.3.
Very elegant...

I have 2 questions regarding Handler class in logging:

1. SocketHandler: Can I send plain string instead of
pickle binary. This will allow me to send a TCP log
message to program written in other programming lang.

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, but how can I do same thing
in loggers' config.ini file.

Thanks in advance

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

Gerhard Häring

unread,
Jul 17, 2003, 11:12:13 AM7/17/03
to
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

0 new messages