Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I make it so log file is stored both remotely and locally using rsyslog?

share|improve this question
up vote 6 down vote accepted

It looks like it's as simple as two lines in the config file:

*.* @loghost
*.* /var/log/messages

The rsyslog example configs have a few instances of teeing like this. The key one:

kern.* /var/adm/kernel
kern.crit @finlandia;RFC3164fmt
kern.crit /dev/console;kern.!err /var/adm/kernel-info

The second statement directs all kernel messages of the priority crit and 
higher to the remote host finlandia.
The third rule directs these messages to the actual console, so the person 
who works on the machine will get them, too.
share|improve this answer

Wouter de Bie had a good answer, but he showed the UDP method of sending logs. In order to send them over the more reliable (though not 100%) TCP use something like:

\*.* @@remote.server.ip
share|improve this answer

Put the following line in your /etc/rsyslog.d/remote.conf:

*.* @remote.server.ip

This can easily be extended for only logging specific facilities and levels to the remote server.

share|improve this answer
Won't this just send the logs to the remote server and not the local one? – Kyle Brandt Sep 15 '10 at 15:52
By default the configuration in Ubuntu for rsyslogd is done in /etc/rsyslog.conf. Here, local logging is already configured. Adding extra files in your /etc/rsyslog.d causes to log to a remote (or local) location as well. The /etc/rsyslog.d directory allows you to extend your configuration (not override it). – Wouter de Bie Sep 15 '10 at 17:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.