I'm trying to monitor log files that some process are running on linux(to create a joint log file where log entries are grouped together by when they happen). Currently I'm thinking of opening the files being logged, polling with inotify(or wrapper) and then checking if I can read any more of the file.
Is there any better way to do this? Perhaps some library which abstracts the reading/changes in the files watched?
Why won't a "tail -f" be sufficient? You could use popen and pipes to handle this from Python.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With