全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1078|回复: 2
打印 上一主题 下一主题

Nginx下如何分割日志?

[复制链接]
跳转到指定楼层
1#
发表于 2010-6-6 13:06:01 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
2#
发表于 2010-6-6 14:48:14 | 只看该作者
logs_path="/home/www/logs/www.acyoo.com.logs/"  这个路径改为自己的
3#
发表于 2010-6-6 15:54:51 | 只看该作者
用logrotate
logrotate.conf
/home/wwwroot/logs/*.log {
        daily
        missingok
        compress
        delaycompress
        dateext
        create  
        notifempty
        sharedscripts

        postrotate
                kill -HUP `cat /usr/local/nginx/logs/nginx.pid`
        endscript
}


crontab:
59 23 * * * root logrotate -f /usr/local/nginx/conf/logrotate.conf
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-10-30 16:26 , Processed in 0.062554 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表