man page

https://man7.org/linux/man-pages/man3/syslog.3.html

install

yum install rsyslog
systemctl start rsyslog
systemctl enable rsyslog
systemctl status rsyslog

config

server

# for udp
#module(load=”imudp”)
#input(type=”imudp” port=”514")
# for tcp
#module(load=”imtcp”)
#input(type=”imtcp” port=”514")
  • facility: the type of process sending logs, can be kernel, cron, daemon, etc.
  • priority: the security level or type of log, emerg (0), alert (1), crit (2), err-(3), warn (4), notice (5), info (6), debug (7).
  • destination: location to save log messages, local file host (/var/log directory), or remote syslog server identified by @ IP:port.

e.g. server with udp opened, for local7.* facility msg:

...
module(load=”imudp”)
input(type=”imudp” port=”514")
...
local7.* /var/log/local7

client

...

local7.* @SERVER_IP:514

test

logger content