HTTP logging

Arnaud Delobelle arnodel at gmail.com
Mon Feb 20 17:16:42 CET 2012


On 20 February 2012 16:03, Jason Friedman <jason at powerpull.net> wrote:
> I am logging to HTTP:
>
> logger.addHandler(logging.handlers.HTTPHandler(host, url))
>
> Works great, except if my HTTP server happens to be unavailable:
>
> socket.error: [Errno 111] Connection refused
>
> Other than wrapping all my logger.log() calls in try/except blocks, is
> there a way to skip logging to the HTTPhandler if the HTTP server is
> unavailable?

Here's one: subclass HTTPHandler :)

-- 
Arnaud



More information about the Python-list mailing list