Rotating Zope Log Files on Windows
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.
kjzz.webmaster@riomail.maricopa.edu wrote:
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.
Any chance you could come out of the stone age? Seriously, you're now 4 major point releases behind what's considered current...
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.
I know Mark Hammond did some work on signal handling for Zope 2.9. There might be something useful there. Failing that, logrotated in cygwin should do you fine. Remember to use copytruncate so you don't have to worry about re-openning log files... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (2)
-
Chris Withers -
kjzz.webmaster@riomail.maricopa.edu