Skip to content

Commit

Permalink
Merge pull request #131 from engineyard/feat/conf-log-verbose
Browse files Browse the repository at this point in the history
feat(controller/logging): Add flag to enable verbose logging
  • Loading branch information
Cryptophobia authored Oct 7, 2020
2 parents 97f0142 + 7c59d1c commit 9346813
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rootfs/api/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
# https://docs.djangoproject.com/en/1.11/ref/settings/#debug
DEBUG = bool(os.environ.get('DEIS_DEBUG', False))

# A boolean flag that turns on/off verbose logging.
LOG_VERBOSE = bool(os.environ.get('LOG_VERBOSE', False))

# If set to True, Django's normal exception handling of view functions
# will be suppressed, and exceptions will propagate upwards
# https://docs.djangoproject.com/en/1.11/ref/settings/#debug-propagate-exceptions
Expand Down Expand Up @@ -175,7 +178,8 @@
'root': {'level': 'DEBUG' if DEBUG else 'INFO'},
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s',
'datefmt': '%Y-%m-%dT%H:%M:%SZ',
},
'simple': {
'format': '%(levelname)s %(message)s'
Expand All @@ -197,7 +201,7 @@
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'simple'
'formatter': 'verbose' if LOG_VERBOSE else 'simple'
}
},
'loggers': {
Expand Down

0 comments on commit 9346813

Please sign in to comment.