Permalink
Browse files

Add file logging

  • Loading branch information...
1 parent d8eccd5 commit 420ce3c2d7476ce2ded5a67717a206384c0f3b45 @julienr committed Mar 3, 2013
Showing with 18 additions and 9 deletions.
  1. +18 −9 ziviweb/settings.py
View
@@ -1,4 +1,5 @@
import os
+import sys
from django.conf import global_settings
# Django settings for ziviweb project.
@@ -161,7 +162,7 @@
'disable_existing_loggers': False,
'root': {
'level': 'WARNING',
- 'handlers': ['sentry'],
+ 'handlers': ['sentry', 'logfile'],
},
'filters': {
'require_debug_false': {
@@ -176,6 +177,14 @@
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
+ 'strm': sys.stdout,
+ },
+ 'logfile': {
+ 'level': 'DEBUG',
+ 'class': 'logging.handlers.RotatingFileHandler',
+ 'filename': 'logs/log.txt',
+ 'maxBytes': 50000,
+ 'backupCount': 2,
}
#'mail_admins': {
#'level': 'ERROR',
@@ -184,25 +193,25 @@
#}
},
'loggers': {
- #'django.request': {
- #'handlers': ['mail_admins'],
- #'level': 'ERROR',
- #'propagate': True,
- #},
+ 'django.request': {
+ 'handlers': ['console'],
+ 'level': 'ERROR',
+ 'propagate': True,
+ },
'django.db.backends':{
'level': 'ERROR',
'handlers': ['console'],
- 'propagate': False,
+ 'propagate': True,
},
'raven': {
'level': 'DEBUG',
'handlers': ['console'],
- 'propagate': False,
+ 'propagate': True,
},
'sentry.errors': {
'level': 'DEBUG',
'handlers': ['console'],
- 'propagate': False,
+ 'propagate': True,
},
}
}

0 comments on commit 420ce3c

Please sign in to comment.