Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   Shoutcast Discussions (http://forums.winamp.com/forumdisplay.php?f=9)
-   -   Daily/Weekly W3C Logging Options (http://forums.winamp.com/showthread.php?t=111110)

richiec79 23rd October 2002 16:15

Daily/Weekly W3C Logging Options
 
Any chance of having an option to break up the logging files to either daily or weekly logs - the current way of just putting them in one massive file is meaning i've got to (briefly) take the server down so i can archive the logs and run stats on them.

Or am I missing something? Is there already a way to do this?

Thanks.

li1997 30th October 2002 08:36

If you are on Win32 find someone who is using Apache on Win32 and grab a copy of rotatelog.exe. You can use this in the same way that Apache does.

If you are on unix/linux you should try a shell script such as:

code:

#!/bin/sh
gzip -c /usr/local/shoutcast/sc_w3c.log > /usr/local/shoutcast/sc_w3c-`date '+%Y%m%d'`.log.gz



You can then call this script whenever you want via cron.

-L"k"

richiec79 30th October 2002 13:52

How exactly does rotatelog.exe work then??

li1997 5th November 2002 06:35

directly from the command line output from rotatelogs (with small SC edits):

Usage: rotatelogs.exe <logfile> <rotation time in seconds> [offset minutes from UTC] or <rotation size in megabytes>

Config like this:

W3CLog="|rotatelogs.exe /some/where 86400"

or

W3CLog="|rotatelogs.exe /some/where 5M"

The generated name will be /some/where.nnnn where nnnn is the system time at which the log nominally starts (N.B. if using a rotation time, the time will always be a multiple of the rotation time, so you can synchronize cron scripts with it). At the end of each rotation time or when the file size is reached a new log is started.

Like I said before though - this is all guesstimation...

-L"k"

Quote:

Originally posted by richiec79
How exactly does rotatelog.exe work then??


All times are GMT. The time now is 15:54.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.