From logging to files to a better solution: syslog, Sentry, Logstash, ....

Thomas Güttler hv at tbz-pariv.de
Wed Sep 16 10:31:41 CEST 2015


Am Mittwoch, 16. September 2015 07:58:11 UTC+2 schrieb dieter:
> Thomas Güttler <hv at tbz-pariv.de> writes:
> > Am Freitag, 11. September 2015 11:03:52 UTC+2 schrieb jmp:
> > ...
> >> Something like (python 2.7)
> >> 
> >> import logging
> >> 
> >> logCfg = {
> >>      'remote':(
> >>          logging.StreamHandler(),
> >>          logging.Formatter('Remote - %(levelname)s - %(message)s'),
> >>          logging.INFO,
> >>          ),
> >>      'vpn':(
> >>          logging.StreamHandler(),
> >>          logging.Formatter('VPN - %(levelname)s - %(message)s'),
> >>          logging.ERROR,
> >>          ),
> >> }
> >
> >
> > .... Yes, I could do it this way.
> >
> > But somehow I am not happy with this solution.
> >
> > I think the filtering should be outside of python.
> 
> Do you think, it will be easier there?
> 
> You could also use the "syslog" handler and use "syslog"
> configuration features to separate the various message levels.
> >From my point of view, this will not be easier - but outside of Python :-)
> 
> And you can develop your own Python logging handler delegating logging to
> your favorite external logging subsystem and then configure that.
> Likely the hardest approach...

Yes, this is a python list. I like python programming.

But I don't want to solve everything with one tool.

I wanted to know how python folks handle their logs.

I think filtering mails should be done outside the python interpreter.

Strange that no one seems to use one of the mentioned tools for log handling.

Regards,
  Thomas


More information about the Python-list mailing list