On the client machine, edit /etc/rsyslog.conf. Add an entry like the one shown below
*.* says that any message of any priority comes under this rule. 10.0.0.2 is the address of the server where the log daemon is running. (Note the @ sign). After making this change, I restarted rsyslog on the client.
On the server, again edit /etc/rsyslog.conf. Look for lines shown below
|# Provides UDP syslog reception|
# Provides TCP syslog reception
Uncomment (remove the #) the module and port number to allow receiving of log messages from the remote client. Restart the rsyslog here again. You will start receiving the messages from the client on your server.
How to test it?
The testing can be done very easily. Use logger on the client to log a message. For example, run,
|logger "Test message from the client"|
You will then see the message appear on the /var/log/messages of the server!