Permalink
Browse files

Things that got away for new log handling

  • Loading branch information...
1 parent c719e86 commit 6be300da8eb137854b5cf960af6b81e00a34d4c3 @harryf committed Mar 6, 2009
Showing with 18 additions and 1 deletion.
  1. +16 −0 dammit/log.py
  2. +2 −1 urldammit.py
View
@@ -0,0 +1,16 @@
+import sys, logging
+from wsgilog import WsgiLog, LogIO
+import config
+
+class Log(WsgiLog):
+ def __init__(self, application):
+ WsgiLog.__init__(
+ self,
+ application,
+ tofile = True,
+ file = config.log_file,
+ interval = config.log_interval,
+ backups = config.log_backups
+ )
+ sys.stdout = LogIO(self.logger, logging.INFO)
+ sys.stderr = LogIO(self.logger, logging.ERROR)
View
@@ -5,6 +5,7 @@
from dammit import cachemanager
from dammit.request import *
from dammit.uri import *
+from dammit.log import Log
import view
from view import render
@@ -309,5 +310,5 @@ def required(input, key):
if __name__ == '__main__':
application = web.application(urls, globals())
- application.run()
+ application.run(Log)

0 comments on commit 6be300d

Please sign in to comment.