Skip to content

Instantly share code, notes, and snippets.

@juan-ignacio-sanchez
Created August 26, 2021 18:52
Show Gist options
  • Select an option

  • Save juan-ignacio-sanchez/9d5ffcd0e1d36f95a8895c20f25c474d to your computer and use it in GitHub Desktop.

Select an option

Save juan-ignacio-sanchez/9d5ffcd0e1d36f95a8895c20f25c474d to your computer and use it in GitHub Desktop.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'default': {
'format': '{levelname} {asctime} {module} {process:d} {thread:d} {message}',
'style': '{'
}
},
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'formatter': 'default'
},
'slack': {
'class': 'mymodule.slack.SlackHandler',
'formatter': 'default'
}
},
'loggers': {
'django': {
'handlers': ['console'],
'level': DJANGO_LOG_LEVEL,
'propagate': True,
},
'my_app': {
'handlers': [
'console',
'slack', # This allows us to send alerts as Slack webhooks
],
'level': MYAPP_LOG_LEVEL,
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment