logging: Add a central log file that logs all errors.

(imported from commit a845c39be69330749475b8a8938bfb736198b953)
This commit is contained in:
Tim Abbott 2013-12-16 15:44:50 -05:00
parent 751f400afb
commit 827aa0e752
1 changed files with 14 additions and 4 deletions

View File

@ -597,6 +597,7 @@ CACHES = {
ZULIP_PATHS = [ ZULIP_PATHS = [
("SERVER_LOG_PATH", "/var/log/zulip/server.log"), ("SERVER_LOG_PATH", "/var/log/zulip/server.log"),
("ERROR_FILE_LOG_PATH", "/var/log/zulip/errors.log"),
("MANAGEMENT_LOG_PATH", "/var/log/zulip/manage.log"), ("MANAGEMENT_LOG_PATH", "/var/log/zulip/manage.log"),
("WORKER_LOG_PATH", "/var/log/zulip/workers.log"), ("WORKER_LOG_PATH", "/var/log/zulip/workers.log"),
("PERSISTENT_QUEUE_FILENAME", "/home/zulip/tornado/event_queues.pickle"), ("PERSISTENT_QUEUE_FILENAME", "/home/zulip/tornado/event_queues.pickle"),
@ -674,26 +675,35 @@ LOGGING = {
'interval': 7, 'interval': 7,
'backupCount': 100000000, 'backupCount': 100000000,
}, },
'errors_file': {
'level': 'WARNING',
'class': 'logging.handlers.TimedRotatingFileHandler',
'formatter': 'default',
'filename': ERROR_FILE_LOG_PATH,
'when': 'D',
'interval': 7,
'backupCount': 100000000,
},
}, },
'loggers': { 'loggers': {
'': { '': {
'handlers': ['console', 'file'], 'handlers': ['console', 'file', 'errors_file'],
'level': 'INFO', 'level': 'INFO',
'propagate': False, 'propagate': False,
}, },
'django': { 'django': {
'handlers': (['zulip_admins'] if ERROR_REPORTING else []) 'handlers': (['zulip_admins'] if ERROR_REPORTING else [])
+ ['console', 'file'], + ['console', 'file', 'errors_file'],
'level': 'INFO', 'level': 'INFO',
'propagate': False, 'propagate': False,
}, },
'zulip.requests': { 'zulip.requests': {
'handlers': ['console', 'file'], 'handlers': ['console', 'file', 'errors_file'],
'level': 'INFO', 'level': 'INFO',
'propagate': False, 'propagate': False,
}, },
'zulip.management': { 'zulip.management': {
'handlers': ['file'], 'handlers': ['file', 'errors_file'],
'level': 'INFO', 'level': 'INFO',
'propagate': False, 'propagate': False,
}, },