skip to navigation
skip to content

pygtail 0.4.0

Reads log file lines that have not been read.

Latest Version: 0.8.0

A python “port” of logcheck’s logtail2.

Pygtail reads log file lines that have not been read. It will even handle log files that have been rotated.


From the command line:

Usage: [options] logfile

Print log file lines that have not been read.

  -h, --help            show this help message and exit
  -o OFFSET_FILE, --offset-file=OFFSET_FILE
                        File to which offset data is written (default:
  -p, --paranoid        Update the offset file every time we read a line
                        (as opposed to only when we reach the end of the
  --no-copytruncate     Don't support copytruncate-style log rotation.
                        Instead, if the log file shrinks, print a warning.

In your code:

from pygtail import Pygtail

for line in Pygtail("some.log"):


Pygtail does not handle rotated logs that have been compressed. You should configure your log rotation script so that the most recently rotated log is left uncompressed (logrotated, for example, has a delaycompress option that does just that).

Build status

File Type Py Version Uploaded on Size
pygtail-0.4.0.tar.gz (md5) Source 2014-05-10 4KB