Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions serve/templates/studio-settings-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ data:
# SECURITY WARNING: don't run with debug turned on in production
{{ if .Values.studio.debug }}
DEBUG = True
DEVELOP_LOGS_ENABLED = True
{{ else }}
DEBUG = False
DEVELOP_LOGS_ENABLED = False
{{ end }}

if DEBUG:
Expand Down Expand Up @@ -87,7 +89,7 @@ data:
STRUCTLOG_MIDDLEWARE = [
"django_structlog.middlewares.RequestMiddleware"
]
DJANGO_STRUCTLOG_CELERY_ENABLED = not DEBUG
DJANGO_STRUCTLOG_CELERY_ENABLED = not DEVELOP_LOGS_ENABLED

# Application definition

Expand Down Expand Up @@ -145,7 +147,7 @@ data:
"waffle.middleware.WaffleMiddleware"
]
+ DJANGO_WIKI_MIDDLEWARE
+ (STRUCTLOG_MIDDLEWARE if not DEBUG else [])
+ (STRUCTLOG_MIDDLEWARE if not DEVELOP_LOGS_ENABLED else [])
)


Expand Down Expand Up @@ -540,11 +542,11 @@ data:
},
"loggers": {
"": {
"handlers": ["console" if DEBUG else "json"],
"level": "DEBUG" if DEBUG else "INFO",
"handlers": ["console" if DEVELOP_LOGS_ENABLED else "json"],
"level": "DEBUG" if DEVELOP_LOGS_ENABLED else "INFO",
},
"django.server": {
"handlers": ["console" if DEBUG else "json"],
"handlers": ["console" if DEVELOP_LOGS_ENABLED else "json"],
"level": "WARNING",
"propagate": False,
},
Expand All @@ -553,7 +555,7 @@ data:

LOGGING = add_loggers(LOGGING, INSTALLED_APPS)

if not DEBUG:
if not DEVELOP_LOGS_ENABLED:
structlog.configure(
processors=[
structlog.contextvars.merge_contextvars,
Expand Down