1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
4 <!-- English Revision: 533344:1343877 (outdated) -->
7 Licensed to the Apache Software Foundation (ASF) under one or more
8 contributor license agreements. See the NOTICE file distributed with
9 this work for additional information regarding copyright ownership.
10 The ASF licenses this file to You under the Apache License, Version 2.0
11 (the "License"); you may not use this file except in compliance with
12 the License. You may obtain a copy of the License at
14 http://www.apache.org/licenses/LICENSE-2.0
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
23 <modulesynopsis metafile="mod_log_forensic.xml.meta">
25 <name>mod_log_forensic</name>
26 <description>サーバに送られたリクエストの forensic ロギング</description>
27 <status>Extension</status>
28 <sourcefile>mod_log_forensic.c</sourcefile>
29 <identifier>log_forensic_module</identifier>
30 <compatibility><module>mod_unique_id</module> はバージョン 2.1 からは必須では
34 <p>このモジュールはクライアントリクエストの forensic ロギングを
35 行ないます。ログ収集はリクエストの処理の前と後に行なわれますので、
36 forensic ログは各リクエストに対して二行ログ収集します。
37 Forensic ロガーは非常に厳密です。これは以下のことを意味します:</p>
40 <li>フォーマットは固定です。実行時にロギングフォーマットを変更することは
42 <li>データを書けない場合は子プロセスはその場で終了し、さらにコアを
43 ダンプするかもしれません (<directive module="mpm_common"
44 >CoreDumpDirectory</directive> ディレクティブの設定に依ります)。</li>
47 <p>Forensic ログの出力を検査するためには、
48 配布物の support ディレクトリにある <code>check_forensic</code>
51 <seealso><a href="../logs.html">Apache ログファイル</a></seealso>
52 <seealso><module>mod_log_config</module></seealso>
54 <section id="formats"><title>Forensic ログフォーマット</title>
55 <p>各リクエストは2回ログ収集されます。最初はリクエストが処理される
56 <em>前</em> (つまり、ヘッダを受け取った後) です。2度目のログは
57 リクエストが処理された<em>後</em>、通常のログ収集と同じときに
60 <p>各リクエストを識別するために、リクエストには
61 一意なリクエスト ID が割り当てられます。この forensic ID は
62 フォーマット文字列 <code>%{forensic-id}n</code> を使うことで
63 通常の transfer ログにログ収集することもできます。
64 <module>mod_unique_id</module> を使っている場合は、それが生成する
67 <p>最初の行は forensic ID、リクエスト行と受け取ったすべてのヘッダを
68 パイプ文字 (<code>|</code>) で分離してログ収集します。
69 例えば以下のようになります (実際はすべて同じ行になります):</p>
72 +yQtJf8CoAB4AAFNXBIEAAAAA|GET /manual/de/images/down.gif
73 HTTP/1.1|Host:localhost%3a8080|User-Agent:Mozilla/5.0 (X11;
74 U; Linux i686; en-US; rv%3a1.6) Gecko/20040216
75 Firefox/0.8|Accept:image/png, <var>etc...</var>
78 <p>最初のプラス文字がこのログは最初のログであることを示します。
79 二番目の行はマイナス文字と ID のみです:</p>
82 -yQtJf8CoAB4AAFNXBIEAAAAA
85 <p><code>check_forensic</code> スクリプトは引数としてログファイルの名前を
86 取ります。<code>+</code>/<code>-</code> の ID の組を調べ、完了していない
87 リクエストがある場合は警告を発します。</p>
90 <section id="security"><title>セキュリティの問題</title>
91 <p>ログファイルが保存されるディレクトリがサーバを起動したユーザ
92 以外で書き込み可能になっているときにセキュリティが破られる可能性が
94 href="../misc/security_tips.html#serverroot">セキュリティのこつ</a>を
99 <name>ForensicLog</name>
100 <description>Forensic ログのファイル名を設定する</description>
101 <syntax>ForensicLog <var>filename</var>|<var>pipe</var></syntax>
102 <contextlist><context>server config</context><context>virtual host</context>
106 <p><directive>ForensicLog</directive> ディレクティブは forensic 解析のための
107 サーバへのリクエストをログ収集に使います。
108 各ログエントリには、普通の <directive module="mod_log_config"
109 >CustomLog</directive> ディレクティブを使ってリクエストと関連付けることの
111 一意な ID が割り当てられます。<module>mod_log_forensic</module> は
112 <code>forensic-id</code> というトークンを作成し、フォーマット文字列
113 <code>%{forensic-id}n</code> を使うことでそのトークンを transfer ログに
116 <p>引数はログが書き出される位置を指定し、以下の 2種類の値のどちらかを
120 <dt><var>filename</var></dt>
121 <dd><directive module="core">ServerRoot</directive> からの
124 <dt><var>pipe</var></dt>
125 <dd>パイプ文字 "<code>|</code>" と、その後にログ情報を標準入力から
126 受け取るプログラム。プログラム名は <directive
127 module="core">ServerRoot</directive> からの相対パスとしても
130 <note type="warning"><title>セキュリティ:</title>
131 <p>プログラムを使う場合、そのプログラムは <program>httpd</program> を起動したユーザで
132 実行されます。つまり、サーバが root で実行された場合は root で
133 実行されるということです。プログラムが安全であるか、より権限の少ない
134 ユーザに切り替えるようになっていることを確かめてください。</p>
137 <note><title>注</title>
138 <p>Unix 以外のプラットフォームでファイル名を入力するときは、
139 プラットフォームがバックスラッシュの使用を許可している場合でも、
140 スラッシュのみが使われるように気をつけてください。
141 普通は設定ファイルすべてにおいて、スラッシュの方を使用するように