Skip to content

Commit 9346813

Browse files
authored
Merge pull request #131 from engineyard/feat/conf-log-verbose
feat(controller/logging): Add flag to enable verbose logging
2 parents 97f0142 + 7c59d1c commit 9346813

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

rootfs/api/settings/production.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
# https://docs.djangoproject.com/en/1.11/ref/settings/#debug
1313
DEBUG = bool(os.environ.get('DEIS_DEBUG', False))
1414

15+
# A boolean flag that turns on/off verbose logging.
16+
LOG_VERBOSE = bool(os.environ.get('LOG_VERBOSE', False))
17+
1518
# If set to True, Django's normal exception handling of view functions
1619
# will be suppressed, and exceptions will propagate upwards
1720
# https://docs.djangoproject.com/en/1.11/ref/settings/#debug-propagate-exceptions
@@ -175,7 +178,8 @@
175178
'root': {'level': 'DEBUG' if DEBUG else 'INFO'},
176179
'formatters': {
177180
'verbose': {
178-
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
181+
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s',
182+
'datefmt': '%Y-%m-%dT%H:%M:%SZ',
179183
},
180184
'simple': {
181185
'format': '%(levelname)s %(message)s'
@@ -197,7 +201,7 @@
197201
'console': {
198202
'level': 'DEBUG',
199203
'class': 'logging.StreamHandler',
200-
'formatter': 'simple'
204+
'formatter': 'verbose' if LOG_VERBOSE else 'simple'
201205
}
202206
},
203207
'loggers': {

0 commit comments

Comments
 (0)