logging.handlers.SocketHandler

Vinay Sajip vinay_sajip at yahoo.co.uk
Fri Mar 6 12:35:21 EST 2009


On Mar 6, 4:09 pm, writeson <doug.farr... at gmail.com> wrote:
> To further complicate my original question, here is more information.
> Theloggingserver I created uses Twisted (2.5.0) as it's network
> framework and gets network log messages from the clients using Twisted
> code. However, once a message is received it is parsed the same way as
> the example you pointed, in fact that's what I used as a model to
> build the code in my def dataReceived() method of myloggingserver
> Twisted protocol. I don't think there is anything unusual about the
> network handling in the Twisted framework.
>
> The client daemons are also Twisted processes, but in their cases they
> don't use any Twisted code to send log messages. The log system is
> entirely based on the Pythonloggingmodule, and thelogging.handlers.SocketHandler system specifically. So the clients
> should try to reconnect if the server goes down and comes back up. So
> I'm a little confused what to try next to resolve the problem I'm
> seeing.
>

This would appear to indicate that the problem is to do with how
Twisted is being used. A couple of avenues to explore would be:

1. Try the simple test client I suggested with your Twisted server and
see what happens. If stuff comes through when the server is restarted,
that would appear to isolate the problem to somewhere in your client
daemons (at least as a working hypothesis).

2. Try the Twisted client daemons with the simple server from the
logging docs. If stuff comes through when the server is restarted,
then the problem might be with your Twisted server daemon.

Of course, it may be necessary to modify the simple seem-to-work test
scripts to accommodate whatever specific wire format is being used in
your problem scenario.

If either of these experiments yield some more information, it's
probably worth taking that to the Twisted community, perhaps the
twisted-python mailing list.

Regards,

Vinay Sajip



More information about the Python-list mailing list