VPS侦探论坛
标题:
nginx日志分割问题
[打印本页]
作者:
yew30
时间:
2024-7-10 15:59
标题:
nginx日志分割问题
我在nginx.conf中配置了如下代码
if($time_iso8601 ~ "^(\d{4})-(\d{2})"){
set $year $1;
set $month $2;
}
access_log /home/wwwlogs/cn/access_${year}_${month}.log;
error_log /home/wwwlogs/cn/error_${year}_${month}.log error;
复制代码
但是很奇怪,access日志可以按月自动生成不同文件,但是error日志不能按月生成,而是文件名直接就是“
error_${year}_${month}.log
”,请教大家是哪里设置错了吗?
欢迎光临 VPS侦探论坛 (https://bbs.lnmp.com/)
Powered by Discuz! X3.4