Closed jfuechsl closed 3 years ago
I'm not sure there is any improvement to the current way the log level is configured here...?
There are only two modes in django, either DEBUG or INFO. Default should be INFO level.
Yeah, I see your point. Setting DEBUG
would set the root logger level to DEBUG
and propagate it down to the child loggers.
The other (for me more important change) is to set the formatter of the console logger to verbose (from simple). Is this something you would approve of?
@jfuechsl , so the question is if we want to use simple
log format vs. verbose
format?
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '{levelname} {asctime} {module} {process:d} {thread:d} {message}',
'style': '{',
},
'simple': {
'format': '{levelname} {message}',
'style': '{',
},
I'm not sure asctime
, module
, process:d
, thread:d
are a big benefit... I think maybe module
is the biggest benefit because it can tell us which parts of the API the error or info message is coming from?
If you change it to verbose
I am not opposed to the change... @kingdonb @felixbuenemann what do you guys think?
We could introduce a LOG_VERBOSE
env var which switches the logging to verbose and otherwise defaults to simple?
We could introduce a LOG_VERBOSE env var which switches the logging to verbose and otherwise defaults to simple?
I like it. That would be the best configurable route to allow for customizing the logs and keep it backwards compatible as a default.
Can you also change the commit msg to chore(...
or feat(...
?
enh(...
is not really supported by our parser here: https://docs.teamhephy.com/contributing/submitting-a-pull-request/#commit-style
I created #131 which supersedes this one. When can close this.
Closing this in favor of https://github.com/teamhephy/controller/pull/131
This PR introduces an env var
LOG_LEVEL
which sets the logging level of the controller. I will open a PR to add the var to the docs once this is ok'd.