Commit 216e9969 by Bridger Maxwell

Tracking now logs to a file including the pid instead of syslog

--HG--
branch : bridger-dev
parent 4b6681b3
...@@ -174,6 +174,7 @@ execfile(os.path.join(BASE_DIR, "settings.py")) ...@@ -174,6 +174,7 @@ execfile(os.path.join(BASE_DIR, "settings.py"))
pid = os.getpid() pid = os.getpid()
hostname = platform.node().split(".")[0] hostname = platform.node().split(".")[0]
SYSLOG_ADDRESS = ('syslog.m.i4x.org', 514) SYSLOG_ADDRESS = ('syslog.m.i4x.org', 514)
LOGGING_FILENAME = 'trackinglog-' + str(pid)
handlers = ['console'] handlers = ['console']
if not DEBUG: if not DEBUG:
...@@ -213,6 +214,11 @@ LOGGING = { ...@@ -213,6 +214,11 @@ LOGGING = {
'address' : SYSLOG_ADDRESS, 'address' : SYSLOG_ADDRESS,
'formatter' : 'syslog_format', 'formatter' : 'syslog_format',
}, },
'filelogger' : {
'level' : 'INFO',
'class' : 'logging.FileHandler',
'filename' : LOGGING_FILENAME,
},
'mail_admins' : { 'mail_admins' : {
'level': 'ERROR', 'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler', 'class': 'django.utils.log.AdminEmailHandler',
...@@ -225,7 +231,7 @@ LOGGING = { ...@@ -225,7 +231,7 @@ LOGGING = {
'level' : 'INFO' 'level' : 'INFO'
}, },
'tracking' : { 'tracking' : {
'handlers' : [] if DEBUG else ['syslogger'], # handlers, 'handlers' : [] if DEBUG else ['filelogger'], # handlers,
'level' : 'DEBUG', 'level' : 'DEBUG',
'propagate' : False, 'propagate' : False,
}, },
...@@ -242,8 +248,6 @@ LOGGING = { ...@@ -242,8 +248,6 @@ LOGGING = {
} }
} }
if PERFSTATS : if PERFSTATS :
MIDDLEWARE_CLASSES = ( 'perfstats.middleware.ProfileMiddleware',) + MIDDLEWARE_CLASSES MIDDLEWARE_CLASSES = ( 'perfstats.middleware.ProfileMiddleware',) + MIDDLEWARE_CLASSES
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment