How can I tail a log file in Python?

So, this is coming quite late, but I ran into the same problem again, and there’s a much better solution now. Just use pygtail:

Pygtail reads log file lines that have not been read. It will even handle log files that have been rotated. Based on logcheck’s logtail2 (http://logcheck.org)

Leave a Comment