in reply to Re: Log file tailing
in thread Log file tailing

Well, that is essentialy what File::Tail does. Except that File::Tail also adjusts the "sleep for x seconds" duration after every read to account for how "busy" the file is: it checks the more frequently updated files more often, and the less frequently updated files less often.

It also checks for files that have suddenly become shorter (as when a sysadmin does a cat /dev/null >logfile in order to free space), and if the file has not been written for a long time, it closes and reopens it - thus hopefully catching cases where the file has been renamed during a log rotation.