プロが教えるわが家の防犯対策術!

RedHat 7.3を使用しております。

現在、ログファイルが、
access_log
referer_log
error_log
と、毎日3ファイル作成されております。

これを、
「access_log」の中に「referer_log」の
情報を含める形にして、
access_log
error_log
と2つファイルが作成されるように
設定を変更したいのですが
どのようにしたらよいでしょうか?

A 回答 (2件)

httpd.confを編集して、combined形式を有効にすればOKです(下記参照)。


#変更後はhttpdの再起動が必要です。



# 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 /var/log/httpd/access_log common
#
# If you would like to have agent and referer logfiles, uncomment the
# following directives.
#
#CustomLog /var/log/httpd/referer_log referer
#CustomLog /var/log/httpd/agent_log agent
#
# If you prefer a single logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
CustomLog /var/log/httpd/access_log combined
    • good
    • 0

LogFormatでログの出力形式を変更して、


CustomLogのファイル名のお尻にLogFormatで指定した名前を付けましょう。
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!