WDlinux官方论坛's Archiver

hydeist 发表于 2012-11-9 15:20

请问一下,你们对服务器日志名字的定义跟日志切割时间的脚本文件在哪个?

我想看看你们写的配置文件。

hydeist 发表于 2012-11-9 15:27

还有个问题,就是每次修改服务器日志配置文件,需要重新启动服务器,才能生效吗?

admin 发表于 2012-11-9 20:27

可以看logrotate

不用重起

hydeist 发表于 2012-11-10 08:03

[b]回复 [url=http://www.wdlinux.cn/bbs/redirect.php?goto=findpost&pid=15515&ptid=4039]3#[/url] [i]admin[/i] [/b]


   logrotate?在哪个目录下啊?

hydeist 发表于 2012-11-10 08:06

:/www/wdlinux/apache/conf/vhost/seoerp.com.conf  我修改这个文件里面的


CustomLog "/www/web_logs/seoerp.com_access_log" combined

把默认的common改为了 combined

就是改变了服务器日志的字段。

然后查看了第二天的日志文件。并没有生效。

hydeist 发表于 2012-11-10 08:28

找到配置文件了。
:/etc/logrotate.d/web_logs


[code]/www/web_logs/*log {        rotate 7        daily        missingok        notifempty        dateext        postrotate        /sbin/service httpd reload > /dev/null 2>&1 || true        /www/wdlinux/wdphp/bin/php /www/wdlinux/wdcp/task/wdcp_weblog.php > /dev/null 2>&1 || true        endscript}        [/code]




:/etc/logrotate.conf


[code]# see "man logrotate" for details# rotate log files weeklyweekly
# keep 4 weeks worth of backlogsrotate 4
# create new (empty) log files after rotating old onescreate
# uncomment this if you want your log files compressed#compress
# RPM packages drop log rotation information into this directoryinclude /etc/logrotate.d
# no packages own wtmp -- we'll rotate them here/var/log/wtmp {    monthly    minsize 1M    create 0664 root utmp    rotate 1}
# system-specific logs may be also be configured here.         [/code]

不知道你们在咋切换APACHE日志跟NGINX日志的。

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.