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


Groups > comp.lang.python > #96246 > unrolled thread

Re: Getting response over logging socket

Started bydieter <dieter@handshake.de>
First post2015-09-10 08:54 +0200
Last post2015-09-10 08:54 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Getting response over logging socket dieter <dieter@handshake.de> - 2015-09-10 08:54 +0200

#96246 — Re: Getting response over logging socket

Fromdieter <dieter@handshake.de>
Date2015-09-10 08:54 +0200
SubjectRe: Getting response over logging socket
Message-ID<mailman.310.1441868114.8327.python-list@python.org>
Larry Martell <larry.martell@gmail.com> writes:

> I have an app that uses the logging package with a SocketHandler to
> send messages. Now I've been asked to change it so that it can receive
> a response for each log message sent. It appears there is no way to do
> this with logging package. Is that true?

You are right.


There are different connotations associated with the term "logging".

One connatation is to inform related parties about events of potential
interest in the current execution. The parties may or may not be
interested. It is of no importance for the current execution whether
some party has processed the event. This is the model, the Python
standard handlers adhere to.

Another connatation is used for transaction management. Those
systems often use a sequentially written "log" and some operations
must only proceed after this "log" has definitely been updated.
For this type of "logging", you need a feedback that the logging
operation has completed successfully.

The Python logging targets the first connatation. For the second
connotation, there are likely better approaches than the standard
Python logging framework (look for "transaction", "transactional").


> Can I not receive data over a
> socket used in a logging handler?

Almost surely, you can develop your own logging handler which
performs a handshake with the logging target. Note that
the logging destination, too, will need to be modified for this.

I assume, however, there will be better approaches that using the
Python logging framework -- e.g. transactional safe message queues.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web