Skip to content

Instantly share code, notes, and snippets.

@ephdtrg
Created August 3, 2021 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ephdtrg/9ae78710abcbefba8ebf40d2d25a2351 to your computer and use it in GitHub Desktop.
Save ephdtrg/9ae78710abcbefba8ebf40d2d25a2351 to your computer and use it in GitHub Desktop.
Informative logging config with formatting
# Enable logging
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'console': {
'format': '%(asctime)s %(levelname)s [%(name)s:%(lineno)s] %(module)s %(process)d %(thread)d | %(message)s',
},
},
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'formatter': 'console',
},
},
'loggers': {
'': {
'level': 'INFO',
'handlers': ['console'],
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment