Add logging configuration for the docker setup

Also remove the PROMETHEUS_URL_PATH from the url, this was just making things
complicated to setup
This commit is contained in:
Roland Geider
2025-04-12 22:04:21 +02:00
parent 43ea6f6153
commit 472de72e66
2 changed files with 29 additions and 1 deletions

View File

@@ -188,3 +188,31 @@ CELERY_RESULT_BACKEND = env.str("CELERY_BACKEND", "redis://cache:6379/2")
#
EXPOSE_PROMETHEUS_METRICS = env.bool('EXPOSE_PROMETHEUS_METRICS', False)
PROMETHEUS_URL_PATH = env.str('PROMETHEUS_URL_PATH', 'super-secret-path')
#
# Logging
#
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'simple': {
'format': 'level={levelname} ts={asctime} module={module} path={pathname} line={lineno} message={message}',
'style': '{',
},
},
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'simple'
},
},
'loggers': {
'': {
'handlers': ['console'],
'level': env.str('LOG_LEVEL_PYTHON', 'INFO').upper(),
'propagate': True,
},
}
}

View File

@@ -353,5 +353,5 @@ if settings.DEBUG:
if settings.EXPOSE_PROMETHEUS_METRICS:
urlpatterns += [
path(f'prometheus/{settings.PROMETHEUS_URL_PATH}/', include('django_prometheus.urls'))
path(f'prometheus/', include('django_prometheus.urls'))
]