/*
mod_log_slow - Logging Slow Request Module for Apache1.3 and Apache2.X */
_ _ _
_ _| | | | | | _
| ' ` \ / \ / | | |/ _ \ / _
| / | |/ \ \ /\ / /
| | | | | | () | (| | | | () | (_| | \ \ | () \ V V /
|| || ||_/ _,|||_/ __, ||/_|_/ _/_/
|____| |/_____|
====================================================================
mod_log_slow is Apache module to provide measures of the time period used for handling each request by the current process. Logging is done after processing a request if the request takes more than certain period of time that you specifiy. The idea of this module comes from MySQL's slow-query-log, and its logging logic is partially based on mod_log_forensic.
====================================================================
http://code.google.com/p/modlogslow/downloads/list
====================================================================
1) extract files from an archive
tar zxf modlogslow-
2) open Makefile and modify ap_basedir variable vi Makefile ap_basedir=/PATH-TO-APACHE-BASE
3) make and install make sudo make install
====================================================================
All the directives below may be specified as per-server configuration.
o LogSlowEnabled
Description: set "On" to enable log_slow, "Off" to disable.
Default "Off"
Syntax: LogSlowEnabled On/Off
Context: server config, virtual host
Status: Extension
Module: mod_log_slow
o LogSlowLongRequestTime
Description: Set the limit of request handling time in millisecond.
Default "1000". Logging is done after processing a request
if the request takes more than LogSlowLongRequestTime.
Syntax: LogSlowLongRequestTime number(millisecond)
Context: server config, virtual host
Status: Extension
Module: mod_log_slow
o LogSlowFileName
Description: Set the filename of the slow log. The SlowLogFileName
directive is used to log requests info that takes more than
the time period specified in LogSlowLongRequestTime directive.
Syntax: LogSlowFileName filename or pipe
Context: server config, virtual host
Status: Extension
Module: mod_log_slow
[note]
In case of using pipe("|"), followed by the path to a program to receive the log information on its standard input.
o LogSlowTimeFormat
Description: Set the time, in the form given by format, which should
be in strftime(3) format. The slow_log's log entries are written
in this format. If not set, the log entries are written in
Common Log Format(CLF) by default.
Syntax: LogSlowTimeFormat timeformat
Context: server config, virtual host
Status: Extension
Module: mod_log_slow
[example]
LogSlowTimeFormat "[%Y-%m-%d %H:%M:%S]"
-> [2009-06-24 00:09:44]
o LogSlowBufferedLogs
Description: set "On" to enable buffered logs flush, "Off" to disable.
Default "Off". Of cource if buffered logs option is set "On",
slow_log is written delayed so as to decrease disk io and thus
to lower the load. Only apache2 module supports.
Syntax: LogSlowBufferedLogs On/Off
Context: server config, virtual host
Status: Extension
Module: mod_log_slow
====================================================================
Slow log entry is written to the file that specified in LogSlowFileName directive, and the logging is made only after the request processing that takes more than the time period specified in LogSlowLongRequestTime directive.
1) Unique ID
mod_log_slow assigns a unique ID for each log entry, and the ID is added to the log string. If you're using mod_unique_id, its generated ID will be used as the unique ID.
2) Slow Log Format