Giter VIP home page Giter VIP logo

mod_log_rotate's Introduction

mod_log_rotate

Original from andya ät apache.org

Modified version from Mario Brandt / JBlond

INTRODUCTION

If you host a lot of virtual servers on a single Apache box and use the supplied rotatelogs program to rotate the access 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.

Note: error log files can not be rotated with this module.

BUILD

See build.md

INSTALL

Copy mod_log_rotate.so to your Apache 2.4.x modules folder
.../apache24/modules/mod_log_rotate.so

USAGE:

LoadModule log_rotate_module modules/mod_log_rotate.so
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

CONFIGURATION DIRECTIVES:

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.

Bugs

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

AVAILABILITY of the original

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

AVAILABILITY of the modified version

https://github.com/JBlond/mod_log_rotate

AVAILABILITY Windows binary x86 and x64

https://www.apachehaus.com/cgi-bin/download.plx

Contribute

Contributers are welcome. Open Pull request or file an issue.

mod_log_rotate's People

Contributors

jblond avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mod_log_rotate's Issues

Release with higher version number

Hello, first of all -- I take it this is the fixed version that works with apache-2.4?

If so, I have a favor to ask. We need to update our Gentoo package for apache-2.4 support, (see https://bugs.gentoo.org/show_bug.cgi?id=532838). We can switch to your version, but the only release on Github is tagged 1.00. Unfortunately the version we have was also 1.00, and we can't just silently swap them (it will cause problems with the package manager).

Would it be possible to make a release as 1.01? That way we can add the fixed version, leaving the old one where it is.

Rotate based on file size

How could I set up a rotation based on file size.

If this feature is not implemented it'll be great if implemented.

Thank you.

Handling of the error_log

According to Apache httpd documentation, all log output is rerouted through the mod_log_rotate handler. This does not seem to be the case for the error_log, as it will stick to the unresolved strftime string.

Maybe it should be mentioned in the readme that the error_log cannot be rotated?

Testing

@SteffenAL can you please check, if the development branch still works in windows?

Handle error.log

Could not find a reason via Google search why the error.log is not handled by mod_log_rotate.

Is it because error.log is typically low volume so does not grow fast enough to need rotating?

Please advise. Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.