Search code examples
emailloggingcentoscentos7rsyslog

centos 7 save rsyslog on local and remote simultaneously


I am administrator of postfix mail server with centos7.

Today network administrator requests that all logs of email service must send to new log server that they run in network recently.

Sending logs to log server done by rsyslog, but my problem is email logs in /var/log/maillog does not saves the logs and its empty and I don`t have access to email logs in log server when I need them for troubleshoot.

How can I config rsyslog to save logs in /var/log/maillog and also send them to remote log server simultaneously? And if rsyslog does not have this ability is there another way to reach this goal?


Solution

  • dont be in a hury, I found it myself. according to link below we can add destinations how many as we want by adding it in true format. for example I added an additional destination by adding this line to /etc/rsyslog.conf:

    mail.* -/var/log/testemail

    read link below: https://www.ostechnix.com/setup-centralized-rsyslog-server-centos-7/