I have some databases which log to a flat text file and I don't think that this version can log to syslog, so I'd like to stream the log file into syslog myself. I figure that keeping something like this running should work:
Code:
tail -f /path/to/logfile | logger
or
Code:
logger -f /path/to/logfile
My question is whether or not there is a better way of doing this?
I think that if this process is restarted, and the logfile is always quite large, that it will read at least some of it again and duplicate that information into syslog which I'd like to avoid.
Is there a better way, some program perhaps that will remember it's position in the logfile and if crashed/restarted will pick up again from that exact point without missing anything or reinserting the same log information again, possibly also handling log truncation or rotation? Does logger -f have an intelligence on this?