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


Groups > comp.lang.python > #96246

Re: Getting response over logging socket

Path csiph.com!eternal-september.org!feeder.eternal-september.org!newsfeed.kamp.net!newsfeed.kamp.net!feeder1.cambriumusenet.nl!feed.tweak.nl!194.109.133.83.MISMATCH!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'handler': 0.04; 'messages.': 0.04; 'model,': 0.05; 'modified': 0.05; 'performs': 0.07; 'socket': 0.07; '"log"': 0.09; 'handlers': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:Getting': 0.09; 'targets': 0.09; 'python': 0.10; 'handshake': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'app': 0.16; 'appears': 0.23; 'second': 0.24; 'written': 0.24; "i've": 0.25; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'logging': 0.27; 'right.': 0.27; 'package.': 0.27; 'processed': 0.27; 'this.': 0.28; 'larry': 0.29; 'asked': 0.29; 'transaction': 0.30; 'e.g.': 0.30; 'operations': 0.31; 'another': 0.32; 'related': 0.32; 'execution': 0.35; 'there': 0.36; 'event.': 0.36; 'framework': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'charset:us-ascii': 0.37; 'associated': 0.38; 'feedback': 0.38; 'log': 0.38; 'data': 0.39; 'to:addr:python.org': 0.40; 'received:de': 0.40; 'some': 0.40; 'term': 0.60; 'your': 0.60; 'different': 0.63; 'safe': 0.63; 'interest': 0.64; 'received:217': 0.66; 'completed': 0.69; 'receive': 0.71; 'approaches': 0.72; 'inform': 0.79; '(look': 0.84; 'execution.': 0.84; 'subject:over': 0.84; 'subject:response': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From dieter <dieter@handshake.de>
Subject Re: Getting response over logging socket
Date Thu, 10 Sep 2015 08:54:58 +0200
References <CACwCsY58KdngvzcRapB0msAYPbJtDubJGKiHtU66nf1GnrRR9A@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Gmane-NNTP-Posting-Host pd9e09977.dip0.t-ipconnect.de
User-Agent Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux)
Cancel-Lock sha1:bZ0/qc45+X7Lu2NO6mSBG6xWG7g=
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.310.1441868114.8327.python-list@python.org> (permalink)
Lines 39
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1441868114 news.xs4all.nl 23741 [2001:888:2000:d::a6]:38962
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:96246

Show key headers only | View raw


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.

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


Thread

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

csiph-web