Django registration error when using daemonize

I need to unmount the django module (using http://noah.org/wiki/Daemonize_Python ).

At the beginning of the daemonize file, I do “import settings” (or “from django.conf import options”) to get the stdout and stderr file names. When I call daemonize with these file names, ALL logging is done for stderr and nothing is logged to stdout. Does anyone have an idea why this is happening?

I am using standard django logging

LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'handlers': { 'mail_admins': { 'level': 'ERROR', 'class': 'django.utils.log.AdminEmailHandler' } }, 'loggers': { 'django.request': { 'handlers': ['mail_admins'], 'level': 'ERROR', 'propagate': True, }, 'django.db.backends': { 'level': 'INFO', }, } } 

Thanks!

+4
source share
1 answer

You have not defined any handlers that register with stderr. See this example configuration for how you can do this.

Update: In general, my answer is still correct. You need to provide a handler for the specific thread that you want to output.

0
source

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


All Articles