In the "client" server, we'll need to edit the same configuration file /etc/rsyslog.conf. I've added the highlighted lines below:
[...]The rest of the config file remains unchanged. Reload/restart the service once we're done:
###############
#### RULES ####
###############
# Log all messages to this rsyslogd host
*.* @@myhost:514
#
# First some standard log files. Log by facility.
#
auth,authpriv.* /var/log/auth.log
*.*;auth,authpriv.none -/var/log/syslog
#cron.* /var/log/cron.log
[...]
myclient:~# /etc/init.d/rsyslog reloadWe can now use the logger command to send log messages to the syslog. Here's what I used:
Reloading enhanced syslogd: rsyslogd.
# logger -t CLIENT_TEST "This is a test to test the test"The following entry should be logged in myhost /var/log/syslog file:
Dec 12 15:17:52 myhost CLIENT_TEST: This is a test to test the test
2 comments:
I found that "*.* @@myhost:514" wasn't working. Removing 1 of the 2 @ fixed it. So I believe it should look like "*.* @myhost:514".
Thanks for the guide.
According to the official documentation, @@ is used for a tcp connection, and @ is used for a udp connection.
Regards,
Raymond
Post a Comment