page counter next up previous contents
Next: logrotate Up: 系統紀錄 Previous: 系統紀錄   Contents

rsyslogd

  1. 查看rsyslog服務是否啟動?
    [root@deyu ~]# ps aux | grep rsyslog
    root      1736  0.0  0.0 248588  1448 ?        Sl   19:51   0:00 /sbin/rsyslogd -c 4
    [root@deyu ~]# chkconfig --list rsyslog
    rsyslog        	0:off	1:off	2:on	3:on	4:on	5:on	6:off
    

  2. rsyslog服務的設定檔
    [root@deyu ~]# cat /etc/rsyslog.conf 
    #### RULES ####
    
    # Log all kernel messages to the console.
    # Logging much else clutters up the screen.
    #kern.*                                                 /dev/console
    
    # Log anything (except mail) of level info or higher.
    # Don't log private authentication messages!
    *.info;mail.none;authpriv.none;cron.none                /var/log/messages
    
    # The authpriv file has restricted access.
    authpriv.*                                              /var/log/secure
    
    # Log all the mail messages in one place.
    mail.*                                                  -/var/log/maillog
        ## "-"表示先儲存在buffer,等資料量夠大才一次性寫入磁碟。
    # Log cron stuff
    cron.*                                                  /var/log/cron
    
    # Everybody gets emergency messages
    *.emerg                                                 *
        ## 產生最嚴重錯誤等級時,將訊息廣播給所有登入的帳號。
    # Save news errors of level crit and higher in a special file.
    uucp,news.crit                                          /var/log/spooler
    
    # Save boot messages also to boot.log
    local7.*                                                /var/log/boot.log
    
  3. rsyslog.conf使用手冊
    [root@deyu ~]# man 5 rsyslog.conf
    



2015-04-13