Skip to content
This repository was archived by the owner on Feb 22, 2021. It is now read-only.

Commit

Permalink
Add logging handler
Browse files Browse the repository at this point in the history
  • Loading branch information
roiravhon committed May 8, 2016
1 parent 3117da8 commit 3c935d8
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ pip install django
pip install djangorestframework
pip install markdown
pip install django-filter
pip install logzio-python-handler
```
39 changes: 39 additions & 0 deletions apollo/apollo/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,45 @@

WSGI_APPLICATION = 'apollo.wsgi.application'

# Logging
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
},
'json': {
'format': '{ "loggerName":"%(name)s", "functionName":"%(funcName)s", "lineNo":"%(lineno)d", "levelName":"%(levelname)s", "message":"%(message)s"}'
}
},
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'level': 'DEBUG',
'formatter': 'verbose'
},
'logzio': {
'class': 'logzio.handler.LogzioHandler',
'level': 'INFO',
'formatter': 'json',
'token': 'itMoHVaqzDNfWPniGyZxACgCesUiCyZy',
'logs_drain_count': 10,
'logs_drain_timeout': 5,
'logzio_type': "apollo"
},
},
'loggers': {
'django': {
'handlers': ['console', ],
'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO')
},
'restapi': {
'handlers': ['console', 'logzio'],
'level': 'INFO'
}
}
}

# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
Expand Down

0 comments on commit 3c935d8

Please sign in to comment.