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