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.

  • 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

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.


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.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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