[Twisted-Python] t.p.syslog, t.p.logger and twistd (was #7549)
Glyph
glyph at twistedmatrix.com
Mon Aug 11 00:09:15 MDT 2014
On Aug 10, 2014, at 3:17 PM, Roberto Polli <roberto.polli at babel.it> wrote:
> Moving thread here to avoid polluting trac (thx to glyph).
>
> 1. the real issue: t.p.syslog doesn't support logLevel
For me, the biggest issue is that t.p.syslog defaults to logging at INFO, which means that on many platforms, all the messages get filtered and don't actually get logs. This is particularly true on OS X, where I think filtering works slightly differently and the INFO filtering happens in the process itself, before it even gets sent to the log server. I haven't even figured out how to configure it not to get filtered.
It seems like getting t.p.syslog to support logLevel is a necessary part of a clean fix, but since most Twisted log messages don't set a level, we would still need better handling on the commandline to make this practically useful to users.
> - if you think it's worth a patch before switching to t.p.logger I'll provide
> a patch (it's quite simple).
> - if you think we should just move to t.p.logger and get rid of t.p.log and
> t.p.syslog see 2.
We definitely can't "get rid of" either of these things. As per the compatibility policy <https://twistedmatrix.com/trac/wiki/CompatibilityPolicy> we would need to deprecate them.
However, "twistd --syslog" could be implemented in terms of t.p.logger instead.
Also, since messages are fairly carefully relayed between new and old logging systems, I think it might be a compatible change to make twisted.python.syslog.startLogging use a new-style (twisted.python.logging) observer, rather than fixing SyslogObserver. The benefit here would be that the new logging system consistently uses levels everywhere. On the other hand, any code written to the new API should be populating the old logLevels key via <https://github.com/twisted/twisted/blob/bd7f43fa202cb78d23098dee165df58737ff9192/twisted/python/logger/_legacy.py#L166-L167>.
> 2. moving twistd to t.p.logger
> - I've started looking around
> - t.p.logger doesn't still support syslog
Yes, we could definitely say that is a blocker :-).
> - I'll try to add some tests
> - feedback welcome :D
I hope some other folks have some ideas :-).
> Ref: https://twistedmatrix.com/trac/ticket/7549
> CONFIDENZIALE: …
I'd like to make it clear that messages sent to this list are NOT confidential - they are publicly archived in multiple places :-). If you can disable a message like this when sending here that would be nice.
-glyph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20140810/4ac2d47c/attachment-0002.html>
More information about the Twisted-Python
mailing list