Created
April 11, 2018 16:37
-
-
Save amgorb/2f8a834f7f1c400c50a8b616f4391117 to your computer and use it in GitHub Desktop.
uWSGI separate JSON logging for application compatible with Elasticsearch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[uwsgi] | |
;this will encode uwsgi messages into JSON, encode requests to JSON and leave application output unchanged | |
;if this output from application has msgName string | |
logger = default stdio | |
logger = secondlogger stdio | |
log-route = secondlogger msgName | |
log-route = default ^((?!msgName).)*$ | |
log-encoder = json:default {"@timestamp":"${strftime:%%Y-%%m-%%dT%%H:%%M:%%S.666Z}","source":"uwsgi", "message":"${msg}"} | |
log-encoder = format:secondlogger ${msg} | |
log-encoder = nl | |
logger-req = stdio | |
log-req-encoder = json {"@timestamp":"${strftime:%%Y-%%m-%%dT%%H:%%M:%%S.666Z}","source":"req", "message":"${msg}"} | |
log-req-encoder = nl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment