-
-
Save k-kawashiman/f364560733df3f04abd2895c0423680a to your computer and use it in GitHub Desktop.
uWSGI separate JSON logging for application compatible with Elasticsearch
This file contains 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