Skip to content

Instantly share code, notes, and snippets.

@MilosSimic
Forked from annacruz/settings.py
Created May 10, 2018 14:44
Show Gist options
  • Save MilosSimic/91e318284901229791d32070b8347068 to your computer and use it in GitHub Desktop.
Save MilosSimic/91e318284901229791d32070b8347068 to your computer and use it in GitHub Desktop.
Default configuration to use ELK stack with django project
LOGGING = {
'handlers': {
'logstash': {
'level': 'DEBUG',
'class': 'logstash.LogstashHandler',
'host': 'localhost',
'port': 5000, # Default port of logstash
'version': 1, # Version of logstash event schema. Default value: 0 (for backward compatibility of the library)
'message_type': 'logstash', # 'type' field in logstash message. Default value: 'logstash'.
'fqdn': False, # Fully qualified domain name. Default value: false.
'tags': ['tag1', 'tag2'], # list of tags. Default: None.
},
},
'loggers': {
'django.request': {
'handlers': ['logstash'],
'level': 'DEBUG',
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment