Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #20625

Re: HTTP logging

References <CANy1k1g1P-1hiC-=Ht5rLp2a6BvM=ZOk2NYL1e9u_BRcZCrSNA@mail.gmail.com>
Date 2012-02-20 16:16 +0000
Subject Re: HTTP logging
From Arnaud Delobelle <arnodel@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.13.1329754605.3037.python-list@python.org> (permalink)

Show all headers | View raw


On 20 February 2012 16:03, Jason Friedman <jason@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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: HTTP logging Arnaud Delobelle <arnodel@gmail.com> - 2012-02-20 16:16 +0000

csiph-web