Open SHxKM opened 7 months ago
Thanks.
Gunicorn is also used in development. There's a Gunicorn loglevel
config option you can add that could be associated with a WEB_LOG_LEVEL
env var that we add. Is that what you were thinking? Alternatively there's https://docs.djangoproject.com/en/5.0/topics/logging.
Just realized what I was really referring to is having Django log level be controlled by an environment variable.
Django has different log levels for different components of its framework. For example here's the default logging settings: https://docs.djangoproject.com/en/5.0/ref/logging/#default-logging-configuration
We would have to override those and reference an env variable. Likely the handlers.console
and loggers.django
sections would be overwritten. The rest can remain hard coded because this project doesn't use the django.server
and having admin emails only report errors is a good default for now.
Really enjoying the quality of this, I was wondering if it'd be handy to have a
LOG_LEVEL
env var (detached fromDEBUG
) that would allow Django to output logs when running with gunicorn in production.