Not strictly a question about programming as such, more of a log handling question.
Anyway. My company has multiple clients, and each of these clients have a set of
logs that I'd rather much want to get sent to by e-mail to me.
Now, another prerequisite is that they're hilighted by simple HTML.
All that is very well, I've managed to make a hilighter for the given log types. So, what I do is I use logrotate's prerotate stuff to send the
logs as an e-mail message. Example:
/var/log/a.log /var/log/b.log {
daily
missingok
copytruncate
prerotate
/usr/bin/python /home/foo/hilight_logs /var/log/{a,b}.log | /usr/sbin/sendmail -FLog\ mailer
[email protected] [email protected]
endscript
}
The problem with this approach is basically that logrotate sucks: it'll run the command for every log file specified in the specifier, and to my knowledge there's no way to know which of the log files is being handled. (Which wouldn't really help anyway.)
Short of repeating the exact same logrotate up to 10 times on different machines, the only thing I can do is just to get bogged down with log spam every night. And I grew tired of it today, so I ask.