< Day Day Up > |
22.11.1 ProblemYour virtual hosts are pretty busy, and sorting out a single log file is getting difficult. How can you give each virtual host its own log file? 22.11.2 SolutionAlter the httpd.conf entries for each virtual host so that they have their own log files: <VirtualHost *:80> ServerName www.tuxcomputing.com ServerAlias tuxcomputing.com *.tuxcomputing.com DocumentRoot /var/www/tuxcomputing ErrorLog /var/www/tuxcomputing/logs error_log AccessLog /var/www/tuxcomputing/logs access_log combined ServerAdmin admin@tuxcomputing.com </VirtualHost> 22.11.3 DiscussionNote that the AccessLog specifies a particular log format with the nickname "combined." There are four ready-made LogFormat directives in httpd.conf: LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent If these do not please you, you can easily create your own. See http://localhost/manual/mod/mod_log_config.html for a complete description of the available variables. This is what the variables in the "combined" LogFormat mean:
22.11.4 See Also
|
< Day Day Up > |