Opened 2 years ago

Last modified 10 months ago

#7969 enhancement assigned

Global filtering in twisted.logger

Reported by: Elvis Stansvik Owned by: Wilfredo Sánchez Vega
Priority: normal Milestone:
Component: twist Keywords:
Cc: Wilfredo Sánchez Vega Branch:


I looked at the new twisted.logger module. The filtering capabilities seems limited to the FilteringLogObserver class, which wraps an existing observer.

It would be nice to be able to do global (process-wide) filtering of events. Unless I'm mistaken, this is currently only possible by replacing the observer of each and every Logger you may have with a FilteringLogObserver that wraps the original one.

Happy to be corrected if I'm wrong. The new logging system looks great.

Change History (4)

comment:1 Changed 2 years ago by Wilfredo Sánchez Vega

Cc: Wilfredo Sánchez Vega added

The intention here is that if your application wants to do that, that you would set up the global log observer to forward through a FilteringLogObserver when you initialize the global observer, and you'd register new observers with that FilteringLogObserver.

twistd perhaps should offer an option to do this, but that would first require that we port twistd to use the new API, which is not done yet.

Either way, we should write up some example code or a bit of utility code to make this easy.

comment:2 Changed 12 months ago by Wilfredo Sánchez Vega

Component: corelogger

comment:3 Changed 11 months ago by Wilfredo Sánchez Vega

Milestone: New Logging System

Closing New Logging System milestone; use logger component for ongoing tickets.

comment:4 Changed 10 months ago by Wilfredo Sánchez Vega

Component: loggertwist
Owner: set to Wilfredo Sánchez Vega
Status: newassigned

twist sets up global filtering, but it doesn't offer a mechanism for altering it at runtime, which would be useful.

Moving this to twist component, since I think that's where the fix goes, and I'll take it.

Note: See TracTickets for help on using tickets.