Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Logging in Nginx+Gunicorn+Supervisor+Django

The I am logging all the caught errors in the django app in the django logger. Where do the errors that do not get caught go? It should go to supervisor log file, in my opinion. But that is empty.

like image 682
Pratik Poddar Avatar asked Sep 29 '13 09:09

Pratik Poddar


1 Answers

According to nginx docs, add line to your configuration file.

access_log  /path/to/your/logs/nginx_access.log;
error_log  /path/to/your/logs/nginx_error.log info;

To log with supervisor, you can add lines to your configuration file like this

[program:program]
command=/virtualenv/python /path/to/django/source/manage.py run_gunicorn --log-file /path/to/your/logs/gunicorn.log
stdout_logfile=/path/to/your/logs/supervisor.log

As you see, gunicorn log is specified in parameter log-file

Finally in django settings you can do the logging according to docs

like image 160
Павел Тявин Avatar answered Nov 03 '22 00:11

Павел Тявин