简体   繁体   中英

How to set apache2.4 custom log

I cannot find how to set a custom log location for my site, using Apache2.4.

<IfModule mod_ssl.c>
  <VirtualHost *:443>
   ....
   php_value error_reporting 2047
   php_flag magic_quotes_gpc off
   php_flag short_open_tag off

   DirectoryIndex index.php index.html

   <Directory /var/www/ablog>
     Options FollowSymLinks
     AllowOverride All

     Order allow,deny
     Allow from all
    </Directory>

    CustomLog ./logs/blog_log common

  </VirtualHost>
</IfModule>

This will result in the following error:

(2)No such file or directory: AH02297: Cannot access directory '/etc/apache2/logs/' for log file './logs/blog_log' defined at /var/www/ablog/vhost.conf:31

For example, the following two sets of directives have exactly the same effect:

CustomLog with format nickname

LogFormat "%h %l %u %t \"%r\" %>s %b" common CustomLog "logs/access_log" common

CustomLog with explicit format string

CustomLog "logs/access_log" "%h %l %u %t \"%r\" %>s %b"

Details are here: http://httpd.apache.org/docs/current/mod/mod_log_config.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM