お世話になります。
Apacheのアクセスログが2行ずつ記録されている状況を解決したく質問させてもらいました。
1アクセスあたりこのように2行ログファイルに記録されます。
198.xxx.xxx.xxx - - [02/Dec/2015:10:47:20 +0900] "POST /result.jsp HTTP/1.1" 301 18 "http://aaabbb.com/result.jsp?area_dir=XXXX" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)" 198.xxx.xxx.xxx - - [02/Dec/2015:10:47:20 +0900] "POST /result.jsp HTTP/1.1" 301 18 "http://aaabbb.com/result.jsp?area_dir=XXXX" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)" 47930 -
2行の違いは行の最後に 47930 - というような数値が入ることです。
httpd.conf httpd-ssl.conf それぞれにCustomLogの記述をしているのが原因でしょうか?
ただ http、httpsとちらのログも1ファイルに取得したいのですがアドバイスいただけませんでしょうか。
# less /usr/local/apache2/conf/httpd.conf
<IfModule log_config_module> # # The following directives define some format nicknames for use with # a CustomLog directive (see below). # LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common # CustomLog SetEnvIf Request_URI \.gif image-request SetEnvIf Request_URI \.jpg image-request SetEnvIf Request_URI \.png image-request SetEnvIf Request_URI \.css image-request <IfModule logio_module> # You need to enable mod_logio.c to use %I and %O LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio </IfModule> # # The location and format of the access logfile (Common Logfile Format). # If you do not define any access logfiles within a <VirtualHost> # container, they will be logged here. Contrariwise, if you *do* # define per-<VirtualHost> access logfiles, transactions will be # logged therein and *not* in this file. # #CustomLog "logs/access_log" common # 更新場所 CustomLog "| /usr/local/sbin/cronolog /usr/local/apache2/logs/access_log.%Y%m%d" combined env=!image-request # # If you prefer a logfile with access, agent, and referer information # (Combined Logfile Format) you can use the following directive. # #CustomLog "logs/access_log" combined </IfModule>
# less /usr/local/apache2/conf/extra/httpd-ssl.conf
# LogSet add ErrorLog "| /usr/local/sbin/cronolog /usr/local/apache2/logs/error_log.%Y%m%d" LogFormat "%h - - %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D %{HTTPS}e" TransferLog "|/usr/local/sbin/cronolog /usr/local/apache2/logs/access_log.%Y%m%d" LogLevel warn
どうぞ宜しくお願い致します。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/12/03 01:53