首页 > 系统服务 > 详细

linux系统日志

时间:2015-10-26 18:59:08      阅读:297      评论:0      收藏:0      [点我收藏+]
linux系统核心日志是在/var/log/messages中的
[root@wangxiangzhe ~]# ls /var/log/messages*
/var/log/messages           /var/log/messages-20151011
/var/log/messages-20150928  /var/log/messages-20151019
/var/log/messages-20151004  /日志是以日期的名字命名的

linux系统日志配置文件是在/etc/logrotate.conf中的

[root@wangxiangzhe ~]# vim /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly      (表示日志每一周切割一次)

# keep 4 weeks worth of backlogs
rotate 4     (保留4个切割后的日志)

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

# use date as a suffix of the rotated file
dateext       (以日期的名字创建新的日志)

# uncomment this if you want your log files compressed
#compress      (日志压缩,不过此项功能并未打开)

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

# no packages own wtmp and btmp -- we‘ll rotate them here
/var/log/wtmp {         //var/log/wtmp用来查看用户的登陆历史,这个日志不能用cat来看,只能                                       用last查看\    monthly   (按月份归档)
    create 0664 root utmp (创建目录的权限,属主和属组)
        minsize 1M  (最小为1M)
    rotate 1       (保留一个)
}

/var/log/btmp {       //这个日志与wtmp类似,用lstab查看,记录无效登录历史、
    missingok
    monthly
    create 0600 root utmp
    rotate 1
}

# system-specific logs may be also be configured here.


linux系统日志

原文:http://zidingyi.blog.51cto.com/10735263/1706414

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!