KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm trying to setup my logging settings to send logging.info('any message') to a file through stdout . This is my gunicorn_django script: $ gunicorn_django -w $NUM_WORKERS --user=$USER --group=$GROUP --log-level=info --log-file=$LOGFILE &>>$LOGFILE These are my logging settings: import sys LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'simple': { 'format': '%(levelname)s %(message)s' }, }, 'filters': { 'require_debug_false': { '()': 'django.utils.log.RequireDebugFalse' } }, 'handlers': { 'console': { 'level': 'INFO', 'filters': ['require_debug_false'], 'class': 'logging.StreamHandler', 'stream': sys.stdout, 'formatter': 'simple', }, 'mail_admins': { 'level': 'ERROR', 'filters': ['require_debug_false'], 'class': 'django.utils.log.AdminEmailHandler' } }, 'loggers': { 'app.location': { 'handlers': ['console'], 'level': 'INFO', 'propagate': False, }, 'django.request': { 'handlers': ['mail_admins'], 'level': 'ERROR', 'propagate': True, }, } } When I do: import logging logging.getLogger('app.location') logging.info('any message') It is not logged to the gunicorn_django $LOGFILE. Just print >> sys.stderr messages seem to be showed in the $LOGFILE How can I log info messages (through stdout) to a file
Tags (comma-separated)
Save Edits
Cancel