[Zope] Rotating Zope Log Files on Windows
kjzz.webmaster at riomail.maricopa.edu
kjzz.webmaster at riomail.maricopa.edu
Fri Mar 31 19:01:48 EST 2006
I am using Zope 2.5.0 (binary release, python 2.1, win32-x86), and the
python 2.1.3 distribution of from python.org as a service on a Windows 2000
server.
I am looking for a solution to rotate zope log files on windows.
I just started writing a batch file to accomplish this, and it seems to work
fairly well:
net stop ZOPE_INSTANCE_SERVICE_NAME
FOR /f "tokens=6-8 delims=/ " %%G IN ('NET TIME \\%computername%') DO (
SET _mm=%%G
SET _dd=%%H
SET _yy=%%I
)
FOR /f "tokens=1,2 delims=: " %%G IN ('time/t') DO (
SET _hr=%%G
SET _min=%%H
)
ECHO Today is Year: [%_yy%] Month: [%_mm%] Day: [%_dd%]
ECHO The time is: [%_hr%]:[%_min%]
REN "C:\Zope_2_8_1_instance\log\Z2.log"
"%_file%-%_yy%-%_mm%-%_dd%@%_hr%-%_min%.log"
del Z2.log
rundll32.exe >C:\Zope_2_8_1_instance\log\Z2.log
net start Zope
net start ZOPE_INSTANCE_SERVICE_NAME
I am thinking of using windows scheduler to run this every night at
midnight. But I wonder if anyone else worked on a similar solution and
could pass along any advice.
Or, conversely, does anyone know how to configure Zope 2.5.0 to send
information that would normally be saved to the Z2.log file to a syslog
utility, (such as the Kwiki Syslog Daemon), found here:
http://www.kiwisyslog.com/info_syslog.htm
Sincerely,
John T.
More information about the Zope
mailing list