From: Erik Abele In order to effectively manage a web server, it is necessary
to get feedback about the activity and performance of the
server as well as any problems that may be occuring. The Apache
@@ -10,7 +10,7 @@
capabilities. This document describes how to configure its
logging capabilities, and how to understand what the logs
contain. Anyone who can write to the directory where Apache is
@@ -29,7 +29,7 @@
The server error log, whose name and location is set by the
The server access log records all requests processed by the
server. The location and content of the access log are
@@ -116,17 +116,14 @@
Various versions of Apache httpd have used other modules and
directives to control access logging, including
mod_log_referer, mod_log_agent, and the
- Apache HTTP Server Version 2.0
Log Files
+ -->Apache HTTP Server Version 2.0
Log Files
Security Warning
+ Security Warning
Error Log
-
+ Related Modules Related Directives ErrorLog
LogLevel
Related Modules Related Directives ErrorLog
LogLevel
ErrorLog
directive, is the
@@ -93,7 +93,7 @@
Access Log
-
+ Related Modules mod_log_config
mod_setenvif
Related Directives CustomLog
LogFormat
SetEnvIf
Related Modules mod_log_config
mod_setenvif
Related Directives CustomLog
LogFormat
SetEnvIf
TransferLog
directive. The CustomLog
- directive now subsumes the functionality of all the older
- directives.TransferLog
directive. The CustomLog
directive now subsumes
+ the functionality of all the older directives.
The format of the access log is highly configurable. The
- format is specified using a
- CustomLog
that
+ format is specified using a CustomLog
that
looks much like a C-style printf(1) format string. Some
examples are presented in the next sections. For a complete
- list of the possible contents of the format string, see the mod_log_config
+ list of the possible contents of the format string, see the mod_log_config
documentation.
\n
" for new-line and
"\t
" for tab.
- The CustomLog
directive sets up a new log file
- using the defined nickname. The filename for the
- access log is relative to the ServerRoot
unless it begins
- with a slash.
The CustomLog
+ directive sets up a new log file using the defined
+ nickname. The filename for the access log is relative to
+ the ServerRoot
unless it
+ begins with a slash.
The above configuration will write log entries in a format known as the Common Log Format (CLF). This standard format can @@ -318,14 +316,13 @@
Multiple access logs can be created simply by specifying
- multiple CustomLog
+ multiple CustomLog
directives in the configuration
file. For example, the following directives will create three
access logs. The first contains the basic CLF information,
while the second and third contain referer and browser
- information. The last two CustomLog
lines show how
- to mimic the effects of the ReferLog
- and AgentLog
directives.
CustomLog
lines show how
+ to mimic the effects of the ReferLog
and AgentLog
directives.
LogFormat "%h %l %u %t \"%r\" %>s %b" common
@@ -335,9 +332,8 @@
This example also shows that it is not necessary to define a
- nickname with the LogFormat
directive. Instead,
- the log format can be specified directly in the
- CustomLog
directive.
LogFormat
directive. Instead,
+ the log format can be specified directly in the CustomLog
directive.
SetEnvIf
. Then the
- env=
clause of the CustomLog
- directive is used to include or exclude requests where the
- environment variable is set. Some examples:
+ env=
clause of the CustomLog
directive is used to
+ include or exclude requests where the environment variable is
+ set. Some examples:
# Mark requests from the loop-back interface
@@ -480,7 +476,7 @@ hosts.If
CustomLog
- orErrorLog
+ orErrorLog
directives are placed inside a<VirtualHost>
section, all requests or errors for that virtual host will be @@ -511,16 +507,14 @@Other Log Files
-+
Related Modules mod_cgi
mod_rewrite
Related Directives PidFile
RewriteLog
RewriteLogLevel
ScriptLog
ScriptLogLength
ScriptBuffer
Related Modules mod_cgi
mod_rewrite
Related Directives PidFile
RewriteLog
RewriteLogLevel
ScriptLog
ScriptLogBuffer
ScriptLogLength
PID File
On startup, Apache httpd saves the process id of the parent httpd process to the file
+ More information is available in the mod_cgi documentation.logs/httpd.pid
. This - filename can be changed with thePidFile -
directive. The + filename can be changed with thePidFile
directive. The process-id is for use by the administrator in restarting and terminating the daemon by sending signals to the parent process; on Windows, use the -k command line option instead. @@ -535,7 +529,7 @@ScriptLog
directive allows you to record the input to and output from CGI scripts. This should only be used in testing - not for live servers. - More information is available in the mod_cgi documentation.Rewrite Log
@@ -547,4 +541,4 @@ the rewriting engine transforms requests. The level of detail is controlled by theRewriteLogLevel
directive. -Apache HTTP Server Version 2.0
\ No newline at end of file +
Apache HTTP Server Version 2.0