Author: dmeyer
Date: Sun Aug 13 19:17:13 2006
New Revision: 8209

Modified:
   trunk/core/src/conf.py

Log:
use RotatingFileHandler, fix bug in logger deleting

Modified: trunk/core/src/conf.py
==============================================================================
--- trunk/core/src/conf.py      (original)
+++ trunk/core/src/conf.py      Sun Aug 13 19:17:13 2006
@@ -65,6 +65,7 @@
 import locale
 import __builtin__
 import logging
+from logging.handlers import RotatingFileHandler
 import gettext
 import gc
 
@@ -172,7 +173,7 @@
 
 # remove handler, we want to set the look and avoid
 # duplicate handlers
-for l in logger.handlers:
+for l in logger.handlers[:]:
     logger.removeHandler(l)
 
 # set stdout logging
@@ -193,7 +194,7 @@
     syslogfile = syslogfile[7:]
     
 syslogfile = '%s/%s-%s' % (LOGDIR, syslogfile, os.getuid())
-handler = logging.FileHandler(syslogfile)
+handler = RotatingFileHandler(syslogfile, maxBytes=1000000, backupCount=2)
 handler.setFormatter(formatter)
 logger.addHandler(handler)
 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to