> On 18 March 2014 01:07, Damjan Georgievski <[email protected]> wrote: >> Anyone using logstash to collect uwsgi logs? >> What are some best practices when configuring uwsgi - or for that matter >> logstash too. >> >> Especially wrt tracebacks from python, ruby and php applications which >> are >> often multiline. > > my issues so far: > > - python and ryby exceptions are logged line per line (unlike php > exceptions)
this can be "improved" with exception-handlers, you could implement an handler directly writing to logstash. The base for writing exception handlers is this one: https://github.com/unbit/uwsgi/blob/master/plugins/exception_log/exception_log.c you do not need to reimplement msgpack generation, as once you load the msgpack plugin, its symbols are exposed > - the uwsgi startup messages are also logged line per line, it would > be much better if it was logged a single message unfortunately i do not see solutions for this, but once you have exceptions stored in the wanted way you can simply ignore them (and eventually store only request logs) > - what's the equivalent to "log-reopen = true" when using "logger = > file:..." modular loggers are reinitialized/reconfigured at every reload > - I have to use the following snippet to have both logstash and stdout > logging: > > logger = stdout file:/dev/tty > log-route = stdout ^ > > plugins = msgpack > logger = logstash socket:192.168.9.10:1717 > log-encoder = msgpack:logstash > map:4|str:message|msg|str:hostname|str:%h|str:version|str:%V|str:appname|str:%n > log-route = logstash ^ > > The claim on http://uwsgi-docs.readthedocs.org/en/latest/Logging.html that > ... logger = file:/tmp/foobar # This logger will log everything as > it's not named ... > > seems to not be true, it doesn't log to tty like that > can't reproduce the problem: ./uwsgi --logger file:/dev/tty -s :3031 -M works ./uwsgi --logger file:/dev/tty -s :3031 -M --logger file:/dev/tty works with doubled lines ./uwsgi --logger file:/dev/tty -s :3031 -M --logger "foobar file:/dev/tty" works showing a single line -- Roberto De Ioris http://unbit.it _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
