Logging for own loggers enabled in config

This commit is contained in:
Dirk Alders 2024-10-07 16:48:03 +02:00
rodzic 9d8641ac31
commit 12fbbcedf8

Wyświetl plik

@ -148,6 +148,43 @@ USE_I18N = True
USE_TZ = True
# Logging Configuration
#
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'short': {
'format': "%(name)25s - %(levelname)10s - %(message)s",
'datefmt': '[%d/%b/%Y %H:%M:%S]',
},
'long': {
'format': """~~~~(%(levelname)-10s)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
File "%(pathname)s", line %(lineno)d, in %(funcName)s
%(asctime)s: %(name)s - %(message)s
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~""",
},
},
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'short',
},
},
'loggers': {
'django': {
'handlers': ['console'],
'level': 'INFO',
'propagate': False,
},
ROOT_LOGGER_NAME: {
'handlers': ['console'],
'level': 'DEBUG' if DEBUG else 'INFO',
'propagate': False,
},
},
}
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.1/howto/static-files/