File::Tail::DirTail all matching files in a given set of directories | |
Download |
File::Tail::Dir Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Jon Schutz
- Publisher web site:
- http://search.cpan.org/~jjschutz/
File::Tail::Dir Tags
File::Tail::Dir Description
File::Tail::Dir is a Perl module that monitors and processes any lines appended to the end of one or more files in a given list of directories, keeping state between sessions, and using kernel notification of file change events to maximise efficiency.A list of directories is given to monitor, and filtering/exclude expressions allow just the files of interest to be selected for notification when lines are appended.This module was originally created to support lossless logging of many Apache web server log files to a Scribe-based logging subsystem (see File::Tail::Scribe, Log::Dispatch::Scribe), and hence key requirements are to keep state, to be able to resume from the last known state between interruptions (like server reboots), and to follow the renaming and creation of new files during log rotation.SYNOPSISTypical usage: use File::Tail::Dir; my $tailer = File::Tail::Dir->new( filter => qr/.*access.*log$/, processor => sub { my ($filename, $lines) = @_; ... }, ); $tailer->watch_files();Or, subclass: package My::Tailer; use Moose; extends 'File::Tail::Dir'; # override standard 'process' method sub process { my ($self, $filename, $lines) = @_; ... }Product's homepage
File::Tail::Dir Related Software