[SOLVED] Have Tracking Center parse another log instead of syslog

larsen

Well-Known Member
Feb 28, 2020
160
19
58
Hello,

I understand that PMG's Tracking Center fetches its data from the syslog files (/var/log/syslog, /var/log/syslog.1, /var/log/syslog.*.gz).
We log all mail related messages to "/var/log/mail.log" on other servers, so I would like to keep it consistent on PMG as well.

A possible workaround would be to log it twice into syslog and mail.log, but that's not ideal. I checked "/usr/share/perl5/PMG/API2/MailTracker.pm" but couldn't see where the log to check is defined.

Where can I change the log that is parsed?


Lars
 
hi,

you can pass -i flag to pmg-log-tracker to specify a different input file
 
Thanks! I just remembered that I wanted to check the --help output for something like this :rolleyes:

It works on the shell for a single file, but it seems to be impossible to have it check mail.log, mail.log.1, mail.log.*.gz at once. This shows only the header lines, but no further output:
Code:
/usr/bin/pmg-log-tracker -l 2 -i '/var/log/mail.log*' -s "1970-01-01 00:00:00"

Therefore, I could adapt MailTracker.pm, but only use the current log and thus be quite limited.
Any workaround for this?
 
The syslog files are hardcoded in the pmg-log-tracker, so this can't be done.
The default is to log mail related things in both the syslog and the mail log. But for cases like this we might be able to switch between the syslog and the mail log.
Could you open an enhancement request in our bug tracker [0] and explain why you need this in detail?


[0] https://bugzilla.proxmox.com/
 
The bug report now has a patch that makes it possible to use "/var/log/mail.log*".