Apache按天保存log日志设置方法

xiaoxiao2021-02-28  105

Apache 设置按天生成日志的方法,主要 %Y-%m-%d,修改 httpd-vhosts.conf 文件

<VirtualHost *:80> ServerAdmin server@uu.com DocumentRoot "/opt/lampp/htdocs/uu/wwwroot" ServerName tj.sugh.net ServerAlias www.tj.sugh.net ErrorLog "|/opt/lampp/bin/rotatelogs /opt/lampp/logs/uu-error_log_%Y-%m-%d.log 86400 480" CustomLog "|/opt/lampp/bin/rotatelogs /opt/lampp/logs/uu-access_log_%Y-%m-%d.log 86400 480" common <Directory /opt/lammp/htdocs/uu/wwwroot/> Options FollowSymLinks AllowOverride All Require all granted Order deny,allow Deny from allow </Directory> </VirtualHost>

保存,然后重启

转载请注明原文地址: https://www.6miu.com/read-69135.html

最新回复(0)