[CalendarServer-changes] [1409] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 21 10:44:13 PDT 2007


Revision: 1409
          http://trac.macosforge.org/projects/calendarserver/changeset/1409
Author:   wsanchez at apple.com
Date:     2007-03-21 10:44:12 -0700 (Wed, 21 Mar 2007)

Log Message:
-----------
Make log rotation an option

Modified Paths:
--------------
    CalendarServer/trunk/conf/caldavd.plist
    CalendarServer/trunk/twistedcaldav/config.py
    CalendarServer/trunk/twistedcaldav/logging.py

Modified: CalendarServer/trunk/conf/caldavd.plist
===================================================================
--- CalendarServer/trunk/conf/caldavd.plist	2007-03-20 21:26:15 UTC (rev 1408)
+++ CalendarServer/trunk/conf/caldavd.plist	2007-03-21 17:44:12 UTC (rev 1409)
@@ -188,6 +188,8 @@
   <!-- Apache-style access log -->
   <key>AccessLogFile</key>
   <string>/var/log/caldavd/access.log</string>
+  <key>RotateAccessLog</key>
+  <true/>
 
   <!-- Server activity log -->
   <key>ErrorLogFile</key>

Modified: CalendarServer/trunk/twistedcaldav/config.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/config.py	2007-03-20 21:26:15 UTC (rev 1408)
+++ CalendarServer/trunk/twistedcaldav/config.py	2007-03-21 17:44:12 UTC (rev 1409)
@@ -109,6 +109,7 @@
     "ErrorLogFile"   : "/var/log/caldavd/error.log",                    # Server activity log
     "ServerStatsFile": "/Library/CalendarServer/Documents/stats.plist",
     "PIDFile"        : "/var/run/caldavd.pid",
+    "RotateAccessLog": True,
 
     #
     # SSL/TLS

Modified: CalendarServer/trunk/twistedcaldav/logging.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/logging.py	2007-03-20 21:26:15 UTC (rev 1408)
+++ CalendarServer/trunk/twistedcaldav/logging.py	2007-03-21 17:44:12 UTC (rev 1409)
@@ -29,6 +29,8 @@
 from twisted.web2.dav import davxml
 from twisted.web2.log import BaseCommonAccessLoggingObserver
 
+from twistedcaldav.config import config
+
 #
 # Logging levels:
 #  0 - no logging
@@ -200,7 +202,10 @@
         Rotate when the date has changed since last write
         """
 
-        return self.toDate() > self.lastDate
+        if config.RotateAccessLog:
+            return self.toDate() > self.lastDate
+        else:
+            return False
 
     def toDate(self, *args):
         """

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070321/7f21f1e4/attachment.html


More information about the calendarserver-changes mailing list