cwconfig.py
branchstable
changeset 5640 8a6d14f4fb9d
parent 5456 d040889fac4e
child 5641 4c1d0e80a376
child 5646 c9550c1239f0
--- a/cwconfig.py	Wed Jun 02 16:12:18 2010 +0000
+++ b/cwconfig.py	Wed Jun 02 16:25:12 2010 +0000
@@ -291,7 +291,9 @@
     name = None
     # log messages format (see logging module documentation for available keys)
     log_format = '%(asctime)s - (%(name)s) %(levelname)s: %(message)s'
-    # nor remove appobjects based on unused interface
+    # the format below can be useful to debug multi thread issues:
+    # log_format = '%(asctime)s - [%(threadName)s] (%(name)s) %(levelname)s: %(message)s'
+    # nor remove appobjects based on unused interface [???]
     cleanup_interface_sobjects = True
     # debug mode
     debugmode = False
@@ -689,7 +691,17 @@
             else:
                 logthreshold = self['log-threshold']
         self.debugmode = debug
-        init_log(debug, syslog, logthreshold, logfile, self.log_format)
+        if sys.platform == 'win32':
+            # no logrotate on win32, so use logging rotation facilities
+            # for now, hard code weekly rotation every sunday, and 52 weeks kept
+            # idea: make this configurable?
+            init_log(debug, syslog, logthreshold, logfile, self.log_format,
+                     rotation_parameters={'when': 'W7', # every sunday
+                                          'interval': 1,
+                                          'backupCount': 52,                                          
+                                         })
+        else:
+            init_log(debug, syslog, logthreshold, logfile, self.log_format)
         # configure simpleTal logger
         logging.getLogger('simpleTAL').setLevel(logging.ERROR)