cwconfig.py
branchstable
changeset 5641 4c1d0e80a376
parent 5630 40d7c7e180f1
parent 5640 8a6d14f4fb9d
child 5647 b21655cfc835
--- a/cwconfig.py	Wed Jun 02 16:13:28 2010 +0200
+++ b/cwconfig.py	Wed Jun 02 16:30:36 2010 +0200
@@ -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)