扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
It sends SYSLOG to a Linux Box
gw#conf t
gw(config)#logging on
gw(config)#logging 192.168.0.2
gw(config)#logging facility local1
gw(config)#logging source-interface e0
Change formats of date, save log into memory. See by "sh logging"
gw(config)#timestamps log datetime msec localtime
gw(config)#service timestamps debug uptime
gw(config)#logging buffered 8192 debugging
Edit /etc/sysconfig/syslog (RedHat7.2) to accept syslog messages remotely
SYSLOGD_OPTIONS="-m 0 -r"
Edit /etc/syslog.conf and add one line as below
...
local1.* /var/log/gw.log
Edit /etc/logrotate.d/syslog to lotate /var/log/gw.log file
/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boo
t.log /var/log/cron /var/log/gw.log {
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || t
rue
endscript
}
Restart Syslog
# /etc/init.d/syslog restart
Shutting down kernel logger: [ OK ]
Shutting down system logger: [ OK ]
Starting system logger: [ OK ]
Starting kernel logger: [ OK ]
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。