Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google StackDrive Logging Level in containers with uwsgi always at Error Level

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.

enter image description here

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

like image 505
EsseTi Avatar asked May 16 '17 15:05

EsseTi


1 Answers

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.

like image 197
Igor Peshansky Avatar answered Sep 19 '22 12:09

Igor Peshansky