请提供一份syslog.conf的配置模板,要求包含kern.warning、*.err、authpriv.none、@loghost*.info、mail.none、authpriv.none、cron.none、@loghost*.emerg、@loghostlocal7.*、@loghost
时间: 2023-07-10 15:41:12 浏览: 64
以下是一份符合要求的 syslog.conf 配置模板:
```bash
# Log all kernel warnings to the console and to the local7 facility on the remote loghost.
kern.warning /dev/console
kern.warning @loghostlocal7.*
# Log all messages with a priority of err or higher to the console and to the remote loghost.
*.err /dev/console
*.err @loghost
# Ignore messages from the authpriv facility from the local system and from the remote loghost.
authpriv.none /var/log/messages
authpriv.none @loghost
# Log all info messages to the local7 facility on the remote loghost and ignore mail messages from all sources.
*.info @loghost
mail.none /var/log/messages
# Ignore messages from the authpriv and cron facilities from all sources.
authpriv.none /var/log/messages
cron.none /var/log/messages
# Log all emergency messages to the local7 facility on the remote loghost and to the local system.
*.emerg @loghostlocal7.*
*.emerg /dev/console
# Log all messages from the local7 facility to the local system and to the remote loghost.
local7.* /var/log/local7.log
local7.* @loghost
```
该配置文件将内核警告记录到本地控制台和远程loghost服务器的local7设施中,将所有错误级别及以上的消息记录到本地控制台和远程loghost服务器,并将某些设施的消息记录到不同的文件中。它还指定了将某些消息发送到远程loghost服务器的方式。
请注意,具体的配置需根据您的实际需要进行修改。例如,您可能需要将某些设施的日志消息记录到不同的远程服务器或记录到不同的本地文件中。