I've set the logging level to INFO for loggers and handlers. Everything works as expected when I run Django on my local machine with ./manage.py runserver
. However, on Apache server with WSGI, the log contains only WARNING logs.
The DEBUG
variable is set to True
in both cases. Here is critical part of my settings.py
:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'normal': {
'format': '%(levelname)s %(asctime)s %(module)s %(message)s'
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'file': {
'level': 'INFO',
'class': 'logging.FileHandler',
'filename': '/var/log/clawd.log',
'formatter': 'normal'
},
'console': {
'level': 'INFO',
'class': 'logging.StreamHandler',
'formatter': 'normal'
},
},
'loggers': {
'django': {
'handlers': ['file', 'console'],
'level': 'INFO',
'propagate': True
}
}
}
State of the log after GET request on the local machine:
INFO 2018-01-18 22:07:38,935 basehttp "GET /case/new/doc/1 HTTP/1.1" 200 337
On the server:
Any idea how could that happen? How Django even knows that it is running on a server when the DEBUG flag is still True?