0

How can I set a custom log file for each postfix instance?

Specifically, I need to identify entries generated for different instances of postfix, and would be better for the tooling if each instance had its own log file in a different folder.

It seems I can specify syslog_name and syslog_facility on main.cf. The first one only changes the text prepended to the log entry in mail.log, so the log file is the same, the second seems to allow me to redirect the log to a different file, but appears be limited to only 8 different entries in syslog (local0-7) and a lot of apps already use that and I fear log entries not related to postfix end up appearing there.

Is this the only way or am I missing something?

Natan
  • 183
  • 1
  • 2
  • 8

1 Answers1

3

After configuring an instance name using syslog_name or multi_instance_name to set the name. You can use rsyslog filters to separate logs from each instance. No need to use the local syslog facilities.

You can find similar solutions for other syslog implementations.

melsayed
  • 1,124
  • 1
  • 6
  • 11