home *** CD-ROM | disk | FTP | other *** search
- /note></dd>
- </dl>
-
- <p>The second argument specifies what will be written to the
- log file. It can specify either a <var>nickname</var> defined by
- a previous <directive module="mod_log_config">LogFormat</directive>
- directive, or it can be an explicit <var>format</var> string as
- described in the <a href="#formats">log formats</a> section.</p>
-
- <p>For example, the following two sets of directives have
- exactly the same effect:</p>
-
- <example>
- # CustomLog with format nickname<br />
- LogFormat "%h %l %u %t \"%r\" %>s %b" common<br />
- CustomLog logs/access_log common<br />
- <br />
- # CustomLog with explicit format string<br />
- CustomLog logs/access_log "%h %l %u %t \"%r\" %>s %b"
- </example>
-
- <p>The third argument is optional and controls whether or
- not to log a particular request based on the
- presence or absence of a particular variable in the server
- environment. If the specified <a href="../env.html">environment
- variable</a> is set for the request (or is not set, in the case
- of a '<code>env=!<var>name</var></code>' clause), then the
- request will be logged.</p>
-
- <p>Environment variables can be set on a per-request
- basis using the <module>mod_setenvif</module>
- and/or <module>mod_rewrite</module> modules. For
- example, if you want to record requests for all GIF
- images on your server in a separate logfile but not in your main
- log, you can use:</p>
-
- <example>
- SetEnvIf Request_URI \.gif$ gif-image<br />
- CustomLog gif-requests.log common env=gif-image<br />
- CustomLog nongif-requests.log common env=!gif-image
- </example>
- </usage>
- </directiv