Skip to content
mod_log_rotate module log rotation for apache
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Create LICENSE Oct 9, 2014 Update binary download url Jan 21, 2019 added VC11 Dec 12, 2013



Original from (


If you host a lot of virtual servers on a single Apache box and use the supplied rotatelogs
program to rotate the logs you'll notice that your process table is cluttered up with an instance
of rotatelogs for each virtual server. With mod_log_rotate the log rotation is handled by the server
process so you save a bunch of processes and file descriptors.


See [](


Copy to your Apache 2.2.x modules folder


LoadModule log_rotate_module modules/
RotateLogs On

You can specify a strftime() format string as the log file name.

CustomLog logs/%Y%m%d-%H%M%S.access.log common


RotateLogs On|Off   Enable / disable automatic log rotation. Once enabled
					mod_log_rotate takes responsibility for all log output
					server wide even if RotateLogs Off is subsequently
					used. That means that the BufferedLogs directive that
					is implemented by mod_log_config will be ignored.

RotateLogsLocalTime Normally the log rotation interval is based on UTC.
					For example an interval of 86400 (one day) will cause
					the logs to rotate at UTC 00:00. When this option is
					on, log rotation is timed relative to the local time.

RotateInterval      Set the interval in seconds for log rotation. The
					default is 86400 (one day). The shortest interval that
					can be specified is 60 seconds. An optional second
					argument specifies an offset in minutes which is
					applied to UTC (or local time if RotateLogsLocalTime
					is on). For example RotateInterval 86400 60 will
					cause logs to be rotated at 23:00 UTC.


A wrong configured placeholder for strftime causes a crash in the module.
So if you use Y% instead of %Y apache crashes with a segfault. This bug is confirmed on Windows
and might happen on *nix based systems, too.
On Windows it is the call of strftime in timestr.c (APR) line ~ 190 [win32_strftime_extra]

AVAILABILITY of the original

mod_log_rotate.c source code is available under the Apache License Version 2.0
original at

AVAILABILITY of the modified version

AVAILABILITY Windows binary x86 and x64
You can’t perform that action at this time.