一般centos系统都会自带syslog服务器,具体开启方法如下:
1.修改/etc/rsyslog.conf
vim /etc/rsyslog.conf
#将以下内容的注释去掉
#$ModLoad imudp
#$UDPServerRun 514
#$ModLoad imtcp
#$InputTCPServerRun 514
2.重启syslog进程
systemctl restart rsyslog
systemctl restart rsyslog.service
3.使用netstat命令检查514端口是否有syslog进程
netstat -anp | grep 514
4.使用命令查看syslog日志:
tail -f /var/log/message #查看syslog日志