Linux系统的日志文件的切分主要是由logrotate来完成的,以centos7为例配置通常在/etc/logrotate.d 目录下

 

添加 nginx 文件

 

cat nginx

 

/var/log/nginx/*.log {
        daily
        missingok
        rotate 52
        compress
        delaycompress
        notifempty
        create 640 root root
        sharedscripts
        postrotate
           # [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`    
            docker inspect -f '{{ .State.Pid }}' nginx | xargs kill -USR1
        endscript
}

 

相关文章:

  • 2021-06-16
  • 2021-12-21
  • 2021-06-26
  • 2021-12-10
  • 2022-12-23
  • 2023-04-03
  • 2022-02-20
猜你喜欢
  • 2021-04-12
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2022-01-22
相关资源
相似解决方案