如何记录每3天轮换目录中的所有错误日志?

时间:2018-09-10 11:18:02

标签: logging

我在服务器上进行一些日志记录,该服务器每隔3天就会收到我希望记录的文件轮换-我在以下目录/var/log中有两个文件console.log和error.log

我对我的/etc/logrotate.conf进行了如下修改-这样行得通吗?

# see "man logrotate" for details
# rotate log files weekly
weekly

# use the syslog group by default, since this is the owning group
# of /var/log/syslog.
su root syslog

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
   missingok
   monthly
   create 0664 root utmp
   rotate 1
}

/var/log/btmp {
   missingok
   monthly
   create 0660 root utmp
   rotate 1
}

# system-specific logs may be configured here
/var/log/mylogs {
   rotate 4
}

0 个答案:

没有答案