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


Groups > comp.lang.python > #96331

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

Newsgroups comp.lang.python
Date 2015-09-11 01:17 -0700
References <5c1f52f5-59d2-48dd-b2e8-3a907a517261@googlegroups.com> <mailman.309.1441867332.8327.python-list@python.org> <e4146cbb-ce6e-47d0-9467-a585c80cac8d@googlegroups.com>
Message-ID <681f390f-9f1d-4968-8226-41db62ae0f9e@googlegroups.com> (permalink)
Subject Re: From logging to files to a better solution: syslog, Sentry, Logstash, ....
From marco.nawijn@colosso.nl

Show all headers | View raw


On Friday, September 11, 2015 at 9:22:42 AM UTC+2, Thomas Güttler wrote:
> 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.
> 
> Ergo, the filtering at Python level does not help in my use case.
> Or I am missing something.
> 
> And now I have an ugly soup. 
> 
> The ugly soup is a text file with not well defined syntax. It looks line
> based. But sometimes there are log messages which span multiple lines ....
> 
> Remember: "Life is too short to (re)write parsers"
> 
> 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.
> 
> Unfortunately there too many choices (graylog, logstash, sentry, ...) :-(
> 
> 
> 
> > >  - Rotating: Rotating files is possible, but somehow cumbersome.
> > 
> > There are standard tools to rotate logfiles.
> > 
> > >  - Support structured logging of values (json) in the future.
> > 
> > Again, the Python logging framework is quite flexible with
> > respect to the format of logged messages.
> > 
> > > ...
> > > Which solution could fit for our environment?
> > 
> > I work for a customer with a similar environment (he uses "Zope" instead
> > of "Django") - and he uses logfiles. The logfiles are automatically
> > rotated and there are in the order of half a dozen to a dozen logfiles
> > per day.
> > 
> > When I have to analyse a problem with the help of the logfiles,
> > I do not copy them via VPN but do the filtering remotely and only
> > copy the filtered portion, if necessary.
> 
> Good to know that I am not the only one running servers in remote intranets.
> 
> Regards,
>   Thomas Güttler

So, if logging to json is on the horizon anyway, why don't you create
something like a MongoDb handler in the standard Python logging framework 
and run a MongoDb server in the client intranet? You could then connect
over VPN to MongoDb, filter the warning/error messages there on the server
side and fetch them to your local systems for analysis.

Marco

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


Thread

From logging to files to a better solution: syslog, Sentry, Logstash, .... Thomas Güttler <hv@tbz-pariv.de> - 2015-09-09 01:33 -0700
  Re: From logging to files to a better solution: syslog, Sentry, Logstash, .... dieter <dieter@handshake.de> - 2015-09-10 08:41 +0200
    Re: From logging to files to a better solution: syslog, Sentry, Logstash, .... Thomas Güttler <hv@tbz-pariv.de> - 2015-09-11 00:22 -0700
      Re: From logging to files to a better solution: syslog, Sentry, Logstash, .... marco.nawijn@colosso.nl - 2015-09-11 01:17 -0700
        Re: From logging to files to a better solution: syslog, Sentry, Logstash, .... Thomas Güttler <hv@tbz-pariv.de> - 2015-09-15 02:37 -0700
      Re: From logging to files to a better solution: syslog, Sentry, Logstash, .... jmp <jeanmichel@sequans.com> - 2015-09-11 11:02 +0200
        Re: From logging to files to a better solution: syslog, Sentry, Logstash, .... Thomas Güttler <hv@tbz-pariv.de> - 2015-09-15 02:35 -0700
          Re: From logging to files to a better solution: syslog, Sentry, Logstash, .... jmp <jeanmichel@sequans.com> - 2015-09-15 16:36 +0200
          Re: From logging to files to a better solution: syslog, Sentry, Logstash, .... dieter <dieter@handshake.de> - 2015-09-16 07:57 +0200
            Re: From logging to files to a better solution: syslog, Sentry, Logstash, .... Thomas Güttler <hv@tbz-pariv.de> - 2015-09-16 01:31 -0700
      Re: From logging to files to a better solution: syslog, Sentry, Logstash, .... dieter <dieter@handshake.de> - 2015-09-12 08:36 +0200

csiph-web