Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make logging level of the django app configurable #2078

Merged
merged 10 commits into from
Jan 2, 2025
3 changes: 3 additions & 0 deletions dandiapi/api/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ def ready(self):
import dandiapi.api.checks # noqa: F401, RUF100
import dandiapi.api.signals # noqa: F401

# Configure the logging level on just DANDI loggers.
logging.getLogger(__name__.split('.')[0]).setLevel(settings.DANDI_LOG_LEVEL)

if hasattr(settings, 'SENTRY_DSN'):
sentry_sdk.init(
dsn=settings.SENTRY_DSN,
Expand Down
1 change: 1 addition & 0 deletions dandiapi/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def mutate_configuration(configuration: type[ComposedConfiguration]):
DANDI_DANDISETS_BUCKET_PREFIX = values.Value(default='', environ=True)
DANDI_DANDISETS_LOG_BUCKET_NAME = values.Value(environ_required=True)
DANDI_DANDISETS_EMBARGO_LOG_BUCKET_NAME = values.Value(environ_required=True)
DANDI_LOG_LEVEL = values.Value(default='INFO', environ=True)
DANDI_ZARR_PREFIX_NAME = values.Value(default='zarr', environ=True)

# Mainly applies to unembargo
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ passenv =
DJANGO_DANDI_API_URL
DJANGO_DANDI_JUPYTERHUB_URL
DJANGO_DANDI_DEV_EMAIL
DJANGO_DANDI_LOG_LEVEL
DANDI_ALLOW_LOCALHOST_URLS
extras =
dev
Expand All @@ -69,6 +70,7 @@ passenv =
DJANGO_DANDI_API_URL
DJANGO_DANDI_JUPYTERHUB_URL
DJANGO_DANDI_DEV_EMAIL
DJANGO_DANDI_LOG_LEVEL
extras =
dev
commands =
Expand Down
Loading