Error registering in Nginx + Gunicorn + Supervisor + Django

I log all detected errors in a django application in django logger. Where are the bugs that don't get caught? In my opinion, it should go to the supervisor log file. But it is empty.

Appreciate any help. Thanks

+6
source share
1 answer

According to nginx docs, add a 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 in using the 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 can see, gunicorn log is specified in the log-file parameter

Finally, in django settings you can do the registration according to docs

+8
source

Source: https://habr.com/ru/post/954877/


All Articles