Logging to HTTP or File

Robert Rawlins - Think Blue robert.rawlins at thinkbluemedia.co.uk
Wed Feb 27 05:16:33 EST 2008


Hello Chaps,

 

I'm after some advice on the best way to handle a logging job. Essentially I
have data which I'm looking to log to a webservice, it would make good sense
I think to use something like the HTTP handler for the python logging API.

 

The problem comes when the application isn't 'online' as it were, with no
network connection or if the webservice isn't currently available. In this
case I don't want to simply loose all the log data, I want it stored into a
file, I can then run hourly batch/cron tasks to upload to the service when
the system comes back online.

 

How would you manage this? I'm thinking about building my own custom log
handler for the task, which if unable to resolve the webservice will just
log to the file instead, I'm just not sure if there is a better way of
achieving this, what are your thoughts?

 

In addition to this, does anyone know which libararys the HTTP handler uses
to make its call? Is it a good one which will recognise if the system has no
network connection or if the server is temporarily unavailable? Is it
asynchronous?

 

Thanks for any advice guys,

 

Robert

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080227/3e3a81a1/attachment.html>


More information about the Python-list mailing list