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; } }
In reply to Logging question by wellsja
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |