爱因斯坦耸耸肩

Linux:日志管理

 

 常见日志的作用:

 

 

 

/etc/rsyslog.conf 配置文件:

日志等级:

等级名称 说明
debug 一般的调试信息说明
info 基本的通知信息
notice 普通信息,但是有一定的重要性
warning 警告信息,但是还不会影响到服务或系统的运行
err 错误信息,一般达到err等级的信息已经可以影响到系统的运行了
crit 临界状况的信息,比err等级还要严重
alert 警告状态信息,比crit还要严重。必须立即采取行动
emerg 疼痛等级信息,系统已经无法使用了

日志轮替:/etc/logrotate.conf 配置文件

[adams@localhost etc]$ cat /etc/logrotate.conf 
# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 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

# system-specific logs may be also be configured here.
[adams@localhost etc]$ 

  

 

 

 

 

 

 logrotate命令

 

 

posted on 2019-11-23 22:46  爱因斯坦耸耸肩  阅读(160)  评论(0编辑  收藏  举报

导航