I'm deploying via Kuberenetes come containers on Google Cloud, which are django project and uwsgi to run them.
I'm using the stackdrive logging tool to see the logging, the problem is that all the entries are seen as severity ERROR
even thought they are not error. It seems that the log of uwsgi
is written to stderr
or something like that.
In the picture you can see that django uses INFO
level, but that is received as ERROR
by stackdrive.
this is how i set up uwsgi.
[uwsgi]
master = true
socket = :3031
chdir = .
wsgi-file = docker.wsgi
processes = 4
threads = 2
socket-timeout = 90
harakiri = 90
http = :8000
env = prometheus_multiproc_dir=multi
enable-threads = yes
lazy-apps = yes
pidfile=/tmp/project-master.pid
Kubernetes logs written to stderr
are always tagged as ERROR -- this is hard-coded in the Stackdriver logging agent. Similarly, logs written to stdout
are always tagged with INFO.
If you can configure your application to write non-error log messages to stdout
, please do so. Another possible approach is to write the logs to a file, run the "tail -f
" command on that file as a sidecar container in the same pod, and looking for your logs in Stackdriver Logs Viewer under the sidecar container instead. Finally, you might consider writing your logs directly into the Stackdriver Logging API, which gives you full control over the contents of each entry.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With