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

dieter dieter at handshake.de
Sat Sep 12 02:36:37 EDT 2015


Thomas Güttler <hv at tbz-pariv.de> writes:

> Am Donnerstag, 10. September 2015 08:42:47 UTC+2 schrieb dieter:
>> Thomas Güttler writes:
>> > ...
>> > Why we are unhappy with logging to files:
>> >
>> >  - filtering: We don't want to get INFO messages over the VPN.
>> 
>> You can quite easily control at what level messages are logged with
>> the standard Python logging framework. Each handler has a level
>> and will ignore messages at a lower level.
>
>
> I want INFO to be logged and stored on the remote host.
> Therefore I must not filter INFO messages.
>
> I don't want to pull INFO messages over the VPN.

Thus, you could define one handler which logs at INFO level and
another one which logs at WARNING level. The latter handler
would log only WARNING and more serious events.

> ...
> Yes, there are tools to parse that soup. But why create this soup in 
> the first place?
>
> That's why I want to move from file based logging to a different solution.

As you have explained above, you need this "soup" (both INFO messages
as well as messages above WARNING level - but handled differently).

Define an additional handler which handles "WARNING" (and above).
This is easy with Zope (I do not know for Django).


> Unfortunately there too many choices (graylog, logstash, sentry, ...) :-(

I do not know any of them - but I doubt that they will help you much to
untangle your "soup".




More information about the Python-list mailing list