码迷,mamicode.com
首页 > 其他好文 > 详细

syslog配置

时间:2019-05-09 15:26:56      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:include   cto   call   efault   cron   var   for   default   class   

syslog配置如下:

$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
$ModLoad imjournal # provides access to the systemd journal
$ModLoad imudp
$UDPServerRun 514
$ModLoad imtcp
$InputTCPServerRun 514
$WorkDirectory /var/lib/rsyslog
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$IncludeConfig /etc/rsyslog.d/*.conf
$OmitLocalLogging on
$IMJournalStateFile imjournal.state
*.info;mail.none;authpriv.none;cron.none                /var/log/
authpriv.*                                              /var/log/secure
mail.*                                                  -/var/log/maillog
cron.*                                                  /var/log/cron
uucp,news.crit                                          /var/log/spooler
local7.*                                                /var/log/boot.log
######### GLOBAL DIRECTIVES #### $template IpTemplate,"/var/log/mylog/%FROMHOST-IP%/%$YEAR%-%$MONTH%-%$DAY%.log" *.* ?IpTemplate & ~

syslog日志保存位置:

  /var/log/mylog/%FROMHOST-IP%/%$YEAR%-%$MONTH%-%$DAY%.log

/var/log/mylog/192.168.187.237/2019-05-09.log

syslog配置

标签:include   cto   call   efault   cron   var   for   default   class   

原文地址:https://www.cnblogs.com/xue0123/p/10838314.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!