wellsja has asked for the wisdom of the Perl Monks concerning the following question:
use Log::Log4perl; use Log::Netcool::MMlogger; use IO::Select; # Use a properties file to configure the logging environment # using the configuration provided in the file .log.conf.. # Note that an XML properties file could also be used Log::Log4perl->init("sample.conf"); # # This is an Array to reference the named loggers my $log = Log::Log4perl->get_logger("LogFile"); # ############################################################## # $select = IO::Select->new(); # repeat next two lines for all filehandles to poll open(INFILE, "< file.log") || die; seek(INFILE, 0, 2); $select->add(*INFILE); for (;;) { if (@ready = $select->can_read) { # input waiting on the filehandles in @ready foreach $filehandle (@ready) { while (<$filehandle>) { chomp(); if (m/^Hello/) { $log->error("This is a hello msg"); } else { $log->error("message was not recieved"); } } } sleep 10; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Logging question
by duff (Parson) on May 11, 2004 at 16:33 UTC | |
by fizbin (Chaplain) on May 12, 2004 at 13:16 UTC | |
|
Re: Logging question
by Roy Johnson (Monsignor) on May 11, 2004 at 16:02 UTC | |
|
Re: Logging question
by bmcatt (Friar) on May 11, 2004 at 16:36 UTC |