I was noticing my disk space disappearing faster than expected, and finally narrowed it down to a rewrite.log file that was 4 GB in size!

Is there a way to rotate the various Apache logs (rewrite, error, access, etc.) on a Win32 PC so that only the most recent entries are there and I can limit the data size that results? I found the bit about log rotation on Apache's website but it's Unix-centric.

Edit: I got rotatelogs.exe to work, and it's great except that it slows the server response down noticably so I rejected the idea of using it.

link|improve this question
Rewrite logs are only usually needed when debugging so why do you still have it enabled in the first place? – Graham Dumpleton Nov 11 '09 at 20:03
well, that's a good point... maybe you could elaborate as an answer? (there's still the error + access logs though) – Jason S Nov 12 '09 at 0:37
feedback

2 Answers

You could use mod_log_rotate. It runs as a server process so it won't spawn multiple instances for each virtual server. See http://www.hexten.net/wiki/index.php/Mod-log-rotate for documentation.

link|improve this answer
feedback

Apache indeed can log rewrites. The destination log file is specified by RewriteLog.

Disappearing free space could be a sign that you might need to decrease the logging verbosity. If you don't process this rewrite log later (and I assume that you don't, since processing a 4GB log is a time consuming task), you might tell apache to not write it at all. This is more a facility for debugging rewrite rules during development.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.