Apache defines log format and log records

Source: Internet
Author: User

Operation Steps:

One: Define the format of the log in the Apache master configuration file

Vim/usr/local/apache2/conf/httpd.conf
<ifmodule log_config_module>
Logformat "%h%l%u%t \"%r\ "%>s%b \"%{referer}i\ "\"%{user-agent}i\ "" combined
Logformat "%h%l%u%t \"%r\ "%>s%b" common
Logformat "%h%l%u%t \"%r\ "%>s%b" Alex
<ifmodule logio_module>


Note: First define the output format and alias (combined, Common, Alex) of the log in the main configuration file.


Second: Add the following in the corresponding virtual machine configuration file

Vim/usr/local/apache2/conf/extra/httpd-vhost.conf

customlog "Logs/discuz-access_log" common
Customlog "/tmp/emma.log" Alex


Note: The directory of log output and the format defined in the previous master configuration file.


Three: Reload Apache

Apachectl-s Reload


This article is from the "night Reading Wit Hope female Ghost" blog, please be sure to keep this source http://more3.blog.51cto.com/9929586/1655767

Apache defines log format and logging

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.