ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzaie_5.4.0.1/rzaiemod_log_config.htm

545 lines
34 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="topic" />
<meta name="DC.Title" content="Module mod_log_config" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2002,2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2002,2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rzaiemod_log_config" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Module mod_log_config</title>
</head>
<body id="rzaiemod_log_config"><a name="rzaiemod_log_config"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<!--Java sync-link--><h1 class="topictitle1">Module mod_log_config</h1>
<div><div class="important"><span class="importanttitle">Important:</span> Information
for this topic supports the latest PTF levels for HTTP Server for i5/OS .
It is recommended that you install the latest PTFs to upgrade to the latest
level of the HTTP Server for i5/OS. Some of the topics documented here are
not available prior to this update. See <a href="http://www-03.ibm.com/servers/eserver/iseries/software/http/services/service.html" target="_blank">http://www.ibm.com/servers/eserver/iseries/software/http/services/service.htm</a> <img src="www.gif" alt="Link outside Information Center" /> for more information. </div>
<p><strong>Summary</strong></p>
<p>The module mod_log_config provides for logging of the requests made to
the server, using the Common Log Format or a user-specified format. There
are 3 directives that control log file creation in this module. The TransferLog,
LogFormat, and CustomLog directives are used for log file creation. The TransferLog
directive is used to create a log file. The LogFormat directive is used to
set a custom format. The CustomLog directive to define a log file and format
in one go. The TransferLog and CustomLog directives can be used multiple times
in each server to cause each request to be logged to multiple files. The
other directives in this module control log file archiving. See <a href="rzaielogformat.htm">Log formats for HTTP Server (powered by Apache)</a> for information on the log file formats supported on
HTTP Server (powered by Apache). </p>
<p><strong>Use with virtual hosts</strong></p>
<p>If a <a href="rzaiemod_core.htm#virtualhost">&lt;VirtualHost&gt;</a> section
does not contain any TransferLog or CustomLog directives, the logs defined
for the main server will be used. If it does contain one or more of these
directives, requests serviced by this virtual host will only be logged in
the log files defined within its definition, not in any of the main server's
log files. See the examples below. </p>
<p><strong>Security considerations</strong></p>
<p>See <a href="rzaiesecuritytips.htm">Security tips for HTTP Server</a> for details
on why your security could be compromised if the directory where log files
are stored is writable by anyone other than the user that starts the server. </p>
<p><strong>Directives</strong></p>
<ul><li><a href="#customlog">CustomLog</a></li>
<li><a href="#frcacustomlog">FRCACustomLog</a></li>
<li><a href="#logformat">LogFormat</a></li>
<li><a href="#transferlog">TransferLog</a></li>
</ul>
</div>
<div class="hr" id="customlog"><a name="customlog"><!-- --></a><h2 class="topictitle2">CustomLog</h2>
<div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="void" border="0" rules="none"><tbody><tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Module">Module</a></strong>: mod_log_config</td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Syntax">Syntax</a></strong>: CustomLog <em>file-or-pipe format-or-nickname</em> [<em>env=</em>[!]<em>environment-variable</em>] </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Default">Default</a></strong>: none</td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Context">Context</a></strong>: <span id="customlog__customlog_context"><a name="customlog__customlog_context"><!-- --></a>server config,
virtual host</span></td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Override">Override</a></strong>: none </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Origin">Origin</a></strong>: <span id="customlog__customlog_origin"><a name="customlog__customlog_origin"><!-- --></a>Apache</span></td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__UsageConsiderations">Usage Considerations</a></strong>: The directive can be specified
multiple times in the same configuration file. This is how one would generate
multiple log files for the same server instance. For example, if you want
an access log, agent log, and referer log, you could specify this directive
three separate times with a different file and format. Log files created with
CustomLog will be created with a CCSID of UTF-8 (1208) for Integrated File
System. </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Example">Example</a></strong>: See below.</td>
</tr>
</tbody>
</table>
</div>
<p>The CustomLog directive is used to log requests to the server. A log format
is specified, and the logging can optionally be made conditional on request
characteristics using environment variables. </p>
<dl class="block"><dt class="dlterm"><strong>Parameter One</strong>: <em>file-or-pipe </em></dt>
<dd><ul><li>The <em>file-or-pipe</em> value indicates the filename to which log records
should be written. This is used exactly like the argument to TransferLog;
that is, it is either a full path or relative to the current server root.
If a pipe is specified, it would be the name of a program that would receive
the log file information on standard in. A pipe is specified by using the
pipe character (|) followed by a path to the program name (no space between
them). The program name can be either a path to a QSYS program object or an
IFS path to a symbolic link. The symbolic link would then link to a QSYS program.
Data written to the pipe from the server will be in the FSCCSID that is in
use by the server. </li>
</ul>
</dd>
</dl>
<dl class="block"><dt class="dlterm"><strong>Parameter Two</strong>: <em>format-or-nickname </em></dt>
<dd><ul><li>If the value is <em>format</em>, it specifies a format for each line of
the log file. The options available for the format are exactly the same as
for the argument of the LogFormat directive. If the format includes any spaces
(which it will in almost all cases) they should be enclosed in double quotes.
If the argument is nickname, that nickname will tie back to a LogFormat directive
with the same specified nickname.<p>If the nickname "DDS" is specified, the
server will create a DDS log file and each record will contain the format
described by file QHTTPSVR/QAZHBLOG. When the second argument is "DDS", a
path name to a file in the QSYS.LIB file system must also be specified. When
"DDS" is specified, it is not necessary to use the Logformat directive to
define the format. The nickname "DDS" is a special nickname that is predefined
in HTTP Server. </p>
</li>
</ul>
</dd>
</dl>
<dl class="block"><dt class="dlterm"><strong>Parameter Three</strong>: <em>[env=[!]environment-variable] </em></dt>
<dd><ul><li>The optional <em>env= </em>clause controls whether a particular request
will be logged in the specified file or not. If the specified environment
variable is set for the request (or is not set, in the case of a 'env=!name'
clause), then the request will be logged. Environment variables can be set
on a per-request basis using the mod_setenvif and/or mod_rewrite modules.<p>There
is no way to specify conditional logging for requests handled by Fast Response
Cache Accelerator (FRCA). That is, environment variable conditions have no
affect on the selection of FRCA requests that are logged. If FRCA is being
used and a FRCACustomLog is not configured, all requests handled by FRCA will
be logged in the CustomLog. The environment variable conditions continue to
apply to requests not served from FRCA. </p>
</li>
</ul>
</dd>
</dl>
<p>For example, if you want to record requests for all GIF images on your
server in a separate log file, but not your main log, you can use: </p>
<pre class="block">SetEnvIf Request_URI \.gif$ fig-image
CustomLog gif-requests.log common env-gif-image
CustomLog nongif-requests.log common env=!gif-image</pre>
<p>Examples of CustomLog:</p>
<pre class="block"># CustomLog with format nickname
LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common
CustomLog logs/access_log common
# CustomLog in QSYS with format nickname
LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common
CustomLog /QSYS.LIB/MYLIB.LIB/MYLOG.FILE common
# CustomLog with explicit format string
CustomLog logs/access_log "%h %l %u %t \"%r\" %&gt;s %b"
# CustomLog with env specified
SetEnvIf Request_URI \.gif$ gif-image
CustomLog gif-requests.log common env=gif-image
CustomLog nongif-requests.log common env=!gif-image
# CustomLog defining a piped log
LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common
CustomLog |/QSYS.LIB/MYLIB.LIB/CUSTOMPIPE.PGM common</pre>
<p>For IFS files, the user must create the directories that contain the log
file and must grant the QTMHHTTP user write access to the directory. For
QSYS.LIB logs, the user must create the library that contains the logs. The
server will create the file and members in the specified library. </p>
<div class="note"><span class="notetitle">Note:</span> It is recommended that HTTP Server create the QSYS.LIB log file. If
the QSYS.LIB log file is created with a record length that is too small, log
information may be truncated and lost. By default the server creates all QSYS.LIB
log files with a record size of 512 or greater.</div>
<p>If the filename does not begin with a slash (/) then it is assumed to be
relative to the ServerRoot. If <a href="rzaiemod_core.htm#logcycle">LogCycle</a> is
active and if the path ends without a (/) character, then the path is considered
to be the complete log file name. In this case, the server will add an extension
in the format QCYYMMDDHH, where these variables have the following values: </p>
<ul><li><strong>Q</strong> is a default value that indicates to the server that this is
a log file. </li>
<li><strong>C</strong> is the century indicator (0 for pre-2000, 1 for post-2000). </li>
<li><strong>YY</strong> is the year indicator. </li>
<li><strong>MM</strong> is the month indicator. </li>
<li><strong>DD</strong> is the day indicator. </li>
<li><strong>HH</strong> is the hour indicator (00 = 00:00 (midnight), 23=23:00).<div class="note"><span class="notetitle">Note:</span> This
variable will not be generated for filesystem QDLS</div>
<p>For example, a
path of "/logs/errorlog" results in a file such as "/logs/errorlog.Q100030300".</p>
</li>
</ul>
<p>If <a href="rzaiemod_core.htm#logcycle">LogCycle</a> is active
and if the path ends with a (/) character, then the path is considered to
be the directory that will contain the log file. In this case, the server
will create log files named in the QCYYMMDDHH format. For example, a path
of "/logs/errorlog/" results in a file such as "/logs/errorlog/Q100030300".
If <a href="rzaiemod_core.htm#logcycle">LogCycle</a> is active
and the logfile is in the QSYS filesystem, the name must end in the file component
of the IFS path. Example: </p>
<pre class="block"># Config file directives
LogCycle Daily
LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common
CustomLog /QSYS.LIB/MYLIB.LIB/MYLOGS.FILE common</pre>
<p>The resulting daily log rollovers will be of the form /QSYS.LIB/MYLIB.LIB/MYLOGS.FILE/Qcyymmddhh.MBR. </p>
<p><a href="rzaiemod_core.htm#logcycle">LogCycle</a> Hourly is
not valid if the logfile is in the QDLS filesystem as that filesystem only
supports 8 character file names and 3 character extensions. For QDLS, the
path given on the CustomLog directive must be a directory. For example</p>
<pre class="block">CustomLog /QDLS/MYPATH/LOGS/ common </pre>
<p>If <a href="rzaiemod_core.htm#logcycle">LogCycle</a> is not
active, no special naming is used. The name of the log file given on the CustomLog
directive is used as given for the name of the log file. If the name is a
directory, a default name of http.log will be concatenated to the directory
name to create the log file. For example: </p>
<pre class="block"># Config file directives
LogCycle Off
LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common
CustomLog /logs/path/ common </pre>
<p>The resulting log file will be /logs/path/http.log.</p>
<div class="note"><span class="notetitle">Security:</span> See <a href="rzaiesecuritytips.htm">Security tips for HTTP Server</a> for details on why your security could be compromised
if the directory where log files are stored is writable by anyone other than
the user that starts the server. If a program is used, then it will be run
under the user who started httpd. This will be root if the server was started
by root (be sure that the program is secure). </div>
</div>
</div>
<div class="hr" id="frcacustomlog"><a name="frcacustomlog"><!-- --></a><h2 class="topictitle2">FRCACustomLog</h2>
<div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="void" border="0" rules="none"><tbody><tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Module">Module</a></strong>: mod_log_config </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Syntax">Syntax</a></strong>: FRCACustomLog <em>file-or-pipe file format-or-nickname</em></td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Default">Default</a></strong>: none </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Context">Context</a></strong>: <span id="frcacustomlog__frcacustomlog_context"><a name="frcacustomlog__frcacustomlog_context"><!-- --></a>server config</span></td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Override">Override</a></strong>: none </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Origin">Origin</a></strong>: <span id="frcacustomlog__frcacustomlog_origin"><a name="frcacustomlog__frcacustomlog_origin"><!-- --></a>iSeries™ </span></td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__UsageConsiderations">Usage Considerations</a></strong>: The directive can be specified
multiple times in the same configuration file. This is how one would generate
multiple log files for the same server instance. For example, if you want
an access log, agent log, and referer log, you could specify this directive
three separate times with a different file and format. Log files created with
FRCACustomLog will be created with a CCSID of UTF-8 (1208) for Integrated
File System.</td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Example">Example</a></strong>: See below.</td>
</tr>
</tbody>
</table>
</div>
<p>The FRCACustomLog directive is used to log FRCA requests to the server.
</p>
<dl class="block"><dt class="dlterm"><strong>Parameter One</strong>: <em>file-or-pipe file </em></dt>
<dd><ul><li>The <em>file-or-pipe</em> file value indicates the filename to which log
records should be written. It is either a full path or relative to the current
server root. If a pipe is specified, it would be the name of a program that
would receive the log file information on standard in. A pipe is specified
by using the pipe character "|" followed by a path to the program name (no
space between them). The program name can be either a path to a QSYS program
object or an IFS path to a symbolic link. The symbolic link would then link
to a QSYS program. Note that data written to the pipe from the server will
be in the FSCCSID that is in use by the server. </li>
</ul>
</dd>
</dl>
<dl class="block"><dt class="dlterm"><strong>Parameter Two</strong>: <em>format-or-nickname </em></dt>
<dd><ul><li>The format-or-nickname argument specifies a format or nickname for each
line of the log file . If it is a format, it specifies a format for each line
of the log file. The options available for the format are exactly the same
as for the argument of the LogFormat directive. If the format includes any
spaces (which it will in almost all cases) they should be enclosed in double
quotes. If the argument is a nickname, that nickname will tie back to a LogFormat
directive with the same specified nickname.<p>If the nickname "DDS" is specified,
the server will create a DDS log file and each record will contain the format
described by file QHTTPSVR/QAZHBLOG. When the second argument is "DDS" a path
name to a file in the QSYS.LIB file system must also be specified. When "DDS"
is specified, it is not necessary to use the Logformat directive to define
the format. The nickname "DDS" is a special nickname that is pre-defined in
the server. See directive Logformat for additional considerations for the
DDS nickname. </p>
</li>
</ul>
</dd>
</dl>
<p>Examples of FRCACustomLog:</p>
<pre class="block"># FRCACustomLog with format nickname
LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common
FRCACustomLog logs/FRCAaccess_log common
# FRCACustomLog in QSYS with format nickname
LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common
FRCACustomLog /QSYS.LIB/MYLIB.LIB/MYFRCALOG.FILE common
# CustomLog in QSYS with DDS format
FRCACustomLog /QSYS.LIB/MYLIB.LIB/FRCADDSLOG.FILE DDS
# FRCACustomLog with explicit format string
FRCACustomLog logs/FRCAaccess_log "%h %l %u %t \"%r\" %&gt;s %b"
# FRCACustomLog defining a piped log
LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common
FRCACustomLog |/QSYS.LIB/MYLIB.LIB/PIPELOG.PGM common</pre>
<p>For IFS log files and QSYS log files, the user must create the directories
that contain the log file and must grant the QTMHHTTP user write access to
the directory. For QSYS.LIB logs, the user must create the library that contains
the logs. The server will create the file and members in the specified library. </p>
<div class="note"><span class="notetitle">Note:</span> It is recommended that HTTP Server create the QSYS.LIB log file. If
the QSYS.LIB log file is created with a record length that is too small, log
information may be truncated and lost. By default the server creates all QSYS.LIB
log files with a record size of 512 or greater.</div>
<p>If the filename does not begin with a slash (/) then it is assumed to be
relative to the ServerRoot. If <a href="rzaiemod_core.htm#logcycle">LogCycle</a> is
active and if the path ends without a (/) character, then the path is considered
to be the complete log file name. In this case, the server will add an extension
in the format QCYYMMDDHH, where these variables have the following values: </p>
<ul><li><strong>Q</strong> is a default value that indicates to the server that this is
a log file. </li>
<li><strong>C</strong> is the century indicator (0 for pre-2000, 1 for post-2000). </li>
<li><strong>YY</strong> is the year indicator. </li>
<li><strong>MM</strong> is the month indicator. </li>
<li><strong>DD</strong> is the day indicator. </li>
<li><strong>HH</strong> is the hour indicator (00 = 00:00 (midnight), 23=23:00).<div class="note"><span class="notetitle">Note:</span> this
variable will not be generated for filesystem QDLS</div>
<p>For example, a
path of "/logs/errorlog" results in a file such as "/logs/errorlog.Q100030300".</p>
</li>
</ul>
<p>If <a href="rzaiemod_core.htm#logcycle">LogCycle</a> is active
and if the path ends with a (/) character, then the path is considered to
be the directory that will contain the log file. In this case, the server
will create log files named in the QCYYMMDDHH format. For example, a path
of "/logs/errorlog/" results in a file such as "/logs/errorlog/Q100030300".
If <a href="rzaiemod_core.htm#logcycle">LogCycle</a> is active
and the logfile is in the QSYS filesystem, the name must end in the file component
of the IFS path. Example: </p>
<pre class="block"># Config file directives
LogCycle Daily
LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common
FRCACustomLog /QSYS.LIB/MYLIB.LIB/MYLOGS.FILE common</pre>
<p>The resulting daily log rollovers will be of the form /QSYS.LIB/MYLIB.LIB/MYLOGS.FILE/Qcyymmddhh.MBR.</p>
<p><a href="rzaiemod_core.htm#logcycle">LogCycle</a> Hourly is
not valid if the logfile is in the QDLS filesystem as that filesystem only
supports 8 character file names and 3 character extensions. Also for QDLS,
the path given on the FRCACustomLog directive must be a directory. For example: </p>
<pre class="block">FRCACustomLog /QDLS/MYPATH/LOGS/ common</pre>
<p>The resulting log files would be /QDLS/MYPATH/LOGS/Qcyymmdd.</p>
<p>If <a href="rzaiemod_core.htm#logcycle">LogCycle</a> is not
active, no special naming is used. The name of the log file given on the FRCACustomLog
directive is used as given for the name of the log file. If the name is a
directory, a default name of http.log will be concatenated to the directory
name to create the log file. For example: </p>
<pre class="block"># Config file directives
LogCycle Off
LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common
CustomLog /logs/path/ common </pre>
<p>The resulting log file will be /logs/path/http.log. </p>
<p>If FRCACustomLog is in the configuration, FRCA requests will be logged
to the file specified on the FRCACustomLog directive. All non-FRCA related
requests will be logged to any other custom logs configured with the CustomLog
directive. Example: </p>
<pre class="block">LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common
CustomLog logs/access_log common
FRCACustomLog logs/FRCAaccess_log common</pre>
<p>All FRCA requests will be logged to logs/FRCAaccess_log and all non-FRCA
requests will be logged to logs/access_log. If FRCACustomLog is not specified
in the configuration of the server instance, ALL requests are logged to any
custom logs configured with CustomLog including FRCA requests. </p>
</div>
</div>
<div class="hr" id="logformat"><a name="logformat"><!-- --></a><h2 class="topictitle2">LogFormat</h2>
<div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="void" border="0" rules="none"><tbody><tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Module">Module</a></strong>: mod_log_config </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Syntax">Syntax</a></strong>: LogFormat <em>format [nickname] </em></td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Default">Default</a></strong>: LogFormat "%h %l %u %t \"%r\" %s %b" </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Context">Context</a></strong>: <span id="logformat__logformat_context"><a name="logformat__logformat_context"><!-- --></a>server config,
virtual host </span></td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Override">Override</a></strong>: none </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Origin">Origin</a></strong>: <span id="logformat__logformat_origin"><a name="logformat__logformat_origin"><!-- --></a>Apache</span></td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__UsageConsiderations">Usage Considerations</a></strong>: The directive can be specified
multiple times in the same configuration file. This is how one would generate
multiple log file formats. For example, if you want an access log, agent
log, and referer log, you could specify this directive three separate times
to define the formats of your log files. </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Example">Example</a></strong>: LogFormat "%h %l %u %t \"%r\" %s %b \"%{Referer}i\"
\"%{User-agent}i\"" </td>
</tr>
</tbody>
</table>
</div>
<p>The LogFormat directive sets the format of the default log file named by
the TransferLog directive. See the section on Custom Log Formats for details
on the format arguments. If you include a nickname for the format on the directive
line, you can use that nickname in FRCACutomLog and CustomLog directives rather
than repeating the entire format string. </p>
<dl class="block"><dt class="dlterm"><strong>Parameter One</strong>: <em>format </em></dt>
<dd><ul><li>The <em>format</em> parameter sets the format of the default log file named
by the TransferLog directive. See the section on Custom Log Formats for details
on the format arguments. </li>
</ul>
</dd>
</dl>
<dl class="block"><dt class="dlterm"><strong>Parameter Two</strong>: <em>[nickname] </em></dt>
<dd><ul><li>The optional <em>nickname</em> parameter allows you to include a nickname
for the format on the directive line. </li>
</ul>
</dd>
</dl>
<p>A LogFormat directive that defines a nickname does nothing else. That is,
it only defines the nickname, it doesn't actually apply the format and make
it the default. </p>
<p>If LogFormat is used without a nickname, then any TransferLog directive
that does not specify a format will use the format defined with this directive,
if it happened to be the most recent LogFormat directive in the configuration
file. If another LogFormat directive (without a nickname) is placed in the
configuration file, then that format becomes the new log format to be used
on subsequent TransferLog directives. </p>
<p>The nickname "DDS" is a log format reserved for use in configuring data
description specification (DDS) log files. The server will automatically recognize
this format and create a DDS log file based on QHTTPSVR/QAZHBLOG. The "DDS"
nickname should not be used when defining a new LogFormat. A LogFormat directive
with a nickname of "DDS" will be ignored by the server. The server will assume
a DDS file in QSYS.LIB when the "DDS" nickname appears on the CustomLog or
FRCACustomLog directives. </p>
<p>See <a href="rzaielogformat.htm">Log formats for HTTP Server (powered by Apache)</a> for information
on the log file formats supported on HTTP Server (powered by Apache).</p>
</div>
</div>
<div class="hr" id="transferlog"><a name="transferlog"><!-- --></a><h2 class="topictitle2">TransferLog</h2>
<div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="void" border="0" rules="none"><tbody><tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Module">Module</a></strong>: mod_log_config </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Syntax">Syntax</a></strong>: TransferLog <em>file-or-pipe</em> </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Default">Default</a></strong>: none </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Context">Context</a></strong>: <span id="transferlog__transferlog_context"><a name="transferlog__transferlog_context"><!-- --></a>server config,
virtual host </span></td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Override">Override</a></strong>: none </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Origin">Origin</a></strong>: <span id="transferlog__transferlog_origin"><a name="transferlog__transferlog_origin"><!-- --></a>Apache </span></td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__UsageConsiderations">Usage Considerations</a></strong>: The directive can be specified
multiple times in the same configuration file. This is how one would generate
multiple log files for the same server instance. For example, if you want
an access log, agent log, and referer log, you could specify this directive
three separate times with a different file and most recent LogFormat. Log
files created with TransferLog will be created with a CCSID of UTF-8 (1208)
for Integrated File System. </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Example">Example</a></strong>: TransferLog logs/access_log </td>
</tr>
</tbody>
</table>
</div>
<p>The TransferLog directive adds a log file in the format defined by the
most recent LogFormat directive, or Common Log Format. This is only if no
other default format has been specified. </p>
<dl class="block"><dt class="dlterm"><strong>Parameter</strong>: <em>file-or-pipe </em></dt>
<dd><ul><li>The <em>file-or-pipe</em> parameter specifies either a filename relative
to the ServerRoot or a program to pipe to. Use the pipe symbol (|) followed
by a program to receive the log information in its standard input. Data written
to the pipe from the server will be in UTF-8 (1208) in use by the server.
The new program will not be started for a VirtualHost if it inherits the TransferLog
from the main server.</li>
</ul>
</dd>
</dl>
<p>Examples of TransferLog:</p>
<pre class="block"># IFS example
LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-agent}i\""
TransferLog logs/access_log
# QSYS example
LogFormat "%h %l %u %t \"%r\" %&gt;s %b"
TransferLog /QSYS.LIB/MYLIB.LIB/MYLOGS.FILE
# Piped log example
LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-agent}i\""
TransferLog |/QSYS.LIB/MYLIB.LIB/TRANSPIPE.PGM</pre>
<p>For IFS files, the user must create the directories that contain the log
file and must grant the QTMHHTTP user write access to the directory. For
QSYS.LIB logs, the user must create the library that contains the logs. The
server will create the file and members in the specified library. If the
filename does not begin with a slash (/) then it is assumed to be relative
to the ServerRoot. If LogCycle is active and if the path ends without a (/)
character, then the path is considered to be the complete log file name. In
this case, the server will add an extension in the format QCYYMMDDHH, where
these variables have the following values: </p>
<ul><li><strong>Q</strong> is a default value that indicates to the server that this is
a log file. </li>
<li><strong>C</strong> is the century indicator (0 for pre-2000, 1 for post-2000). </li>
<li><strong>YY</strong> is the year indicator. </li>
<li><strong>MM</strong> is the month indicator. </li>
<li><strong>DD</strong> is the day indicator. </li>
<li><strong>HH</strong> is the hour indicator (00 = 00:00 (midnight), 23=23:00).<div class="note"><span class="notetitle">Note:</span> this
variable will not be generated for filesystem QDLS</div>
<p>For example, a
path of "/logs/errorlog" results in a file such as "/logs/errorlog.Q100030300".</p>
</li>
</ul>
<p>If <a href="rzaiemod_core.htm#logcycle">LogCycle</a> is active
and if the path ends with a (/) character, then the path is considered to
be the directory that will contain the log file. In this case, the server
will create log files named in the QCYYMMDDHH format. For example, a path
of "/logs/errorlog/" results in a file such as "/logs/errorlog/Q100030300".
If <a href="rzaiemod_core.htm#logcycle">LogCycle</a> is active
and the logfile is in the QSYS filesystem, the name must end in the file component
of the IFS path. For example: </p>
<pre class="block"># Config file directives
LogCycle Daily
LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common
TransferLog /QSYS.LIB/MYLIB.LIB/MYLOGS.FILE </pre>
<p>The resulting daily log rollovers will be of the form /QSYS.LIB/MYLIB.LIB/MYLOGS.FILE/Qcyymmddhh.MBR.</p>
<p><a href="rzaiemod_core.htm#logcycle">LogCycle</a> Hourly is
not valid if the logfile is in the QDLS filesystem as that filesystem only
supports 8 character file names and 3 character extensions. If <a href="rzaiemod_core.htm#logcycle">LogCycle</a> is not active, no special naming is used. The name of
the log file given on the TransferLog directive is used as given for the name
of the log file. If the name is a directory, a default name of http.log will
be concatenated to the directory name to create the log file. For example: </p>
<pre class="block"># Config file directives
LogCycle Off
LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common
CustomLog /logs/path/ common</pre>
<p>The resulting log file will be /logs/path/http.log. </p>
<div class="note"><span class="notetitle">Note:</span> See <a href="rzaiesecuritytips.htm">Security tips for HTTP Server</a> for details on why your security could be compromised
if the directory where log files are stored is writable by anyone other than
the user that starts the server. If a program is used, then it will be run
under the user who started httpd. This will be root if the server was started
by root (be sure that the program is secure). </div>
<div class="note"><span class="notetitle">Note:</span> When possible, you should use <a href="#customlog">CustomLog</a> in place
of TransferLog.</div>
</div>
</div>
</body>
</html>