From 3622f81c69cde715dd0bfebdc69a4850d451d8e1 Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Mon, 30 Jan 2012 12:40:35 -0500 Subject: [PATCH] update logging to add pid to filename, so we don't have to worry about multiple processes trying to share the same log file --- settings_new_askbot.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/settings_new_askbot.py b/settings_new_askbot.py index 9786bd1c91..b66091c405 100644 --- a/settings_new_askbot.py +++ b/settings_new_askbot.py @@ -135,6 +135,9 @@ execfile(os.path.join(BASE_DIR, "settings.py")) # the site admins on every HTTP 500 error. # See http://docs.djangoproject.com/en/dev/topics/logging for # more details on how to customize your logging configuration. + +pid = os.getpid() + LOGGING = { 'version': 1, 'disable_existing_loggers': True, @@ -163,14 +166,14 @@ LOGGING = { 'level' : 'DEBUG' if DEBUG else 'INFO', 'class' : 'logging.handlers.WatchedFileHandler', 'formatter' : 'standard', - 'filename' : LOG_DIR + '/mitx.log', # temporary location for proof of concept + 'filename' : '{0}/mitx.{1}.log'.format(LOG_DIR, pid), 'encoding' : 'utf-8', }, 'app_err' : { 'level' : 'WARNING', 'class' : 'logging.handlers.WatchedFileHandler', 'formatter' : 'standard', - 'filename' : LOG_DIR + '/mitx.err.log', # temporary location for proof of concept + 'filename' : '{0}/mitx.err.{1}.log'.format(LOG_DIR, pid), 'encoding' : 'utf-8', }, # We should actually use this for tracking: @@ -179,7 +182,7 @@ LOGGING = { 'level' : 'INFO', 'class' : 'logging.handlers.WatchedFileHandler', 'formatter' : 'raw', - 'filename' : LOG_DIR + '/tracking.log', + 'filename' : '{0}/tracking.{1}.log'.format(LOG_DIR, pid), 'encoding' : 'utf-8', }, 'mail_admins' : {