Add root logging configuration and improve format

Previously no loggers were enabled that concrexit uses. This means that
all logs by concrexit code were ignored in production. This commit adds
a root logger that will make sure all logs by concrexit and imported
packages are logged to the log file.

This commit also improves the 'verbose' logging format, which previously
contained unneeded information and less specific information on which
package was doing the logging.
parent 7687fc82
......@@ -134,15 +134,10 @@ if os.environ.get('DJANGO_EMAIL_HOST'):
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse',
},
},
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s '
'%(process)d %(thread)d %(message)s'
'format': '%(asctime)s %(name)s '
'%(levelname)s %(message)s'
},
},
'handlers': {
......@@ -154,6 +149,7 @@ LOGGING = {
'logfile': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'formatter': 'verbose',
'filename': '/concrexit/log/django.log',
}
},
......@@ -161,7 +157,12 @@ LOGGING = {
'django': {
'handlers': ['console', 'logfile'],
'level': 'INFO',
'propagate': False,
},
'': {
'handlers': ['logfile'],
'level': 'INFO',
}
},
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment