使用rsyslogd在本地和远程login

我怎样才能做到这一点,所以日志文件存储在远程和本地使用rsyslog?

它看起来像configuration文件中的两行一样简单:

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

rsyslog示例configuration有这样的发球几个实例。 关键之一:

 kern.* /var/adm/kernel kern.crit @finlandia;RFC3164fmt kern.crit /dev/console kern.info;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. 

Wouter de Bie有一个很好的答案,但他展示了发送日志的UDP方法。 为了通过更可靠(但不是100%)的TCP使用类似于:

 \*.* @@remote.server.ip 

将以下行放在/etc/rsyslog.d/remote.conf中:

 *.* @remote.server.ip 

只需将特定设施和级别logging到远程服务器即可轻松扩展。