Hardware::UPS::Perl::LoggingHardware::UPS::Perl::Logging is a package of methods for logging. | |
Download |
Hardware::UPS::Perl::Logging Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Christian Reile
- Publisher web site:
- http://search.cpan.org/~drulensot/perl-Hardware-UPS-Perl-0.43/lib/Hardware/UPS/Perl/Logging.pm
Hardware::UPS::Perl::Logging Tags
Hardware::UPS::Perl::Logging Description
Hardware::UPS::Perl::Logging is a package of methods for logging. Hardware::UPS::Perl::Logging is a package of methods for logging.SYNOPSIS use Hardware::UPS::Perl::Logging; $logger = Hardware::UPS::Perl::Logging->new(); $logger = Hardware::UPS::Perl::Logging->new( File => "/var/log/ups.log" Period => 84600, ); $logger = Hardware::UPS::Perl::Logging->new( File => "/var/log/ups.log" Size => 5, ); $logger = Hardware::UPS::Perl::Logging->new( File => "/var/log/ups.log" Scheme => "daily", ); $logger->debug("this is a debug message"); $logger->info("this is a information message"); $logger->error("this is an error message"); $logger->fatal("this is a fatal error message"); $logger->print("this is a message"); $logger->write( Format => $formatString, Arguments => %formatArguments, ); $logger->syslog( level => "LOG_DEBUG", message => "this is a debug message for syslog" ); $logger->sendmail( MailTo => root, Subject => "fatal error", message => "there was a fatal error", ); $logger->rotate(); undef $logger; # closes log fileHardware::UPS::Perl::Logging provides methods to print debug, info, non-fatal and fatal error messages to log files, to syslog or sending them per mail.The log files can be rotated automatically using an ALARM signal handler due to a certain scheme saving up to 10 files on a FIFO basis. The naming convention for such log files is file.YYYY-MM-DD.x with x ranging from 0 to 9. The current log file is always available by the symbolic link file. In case of a restart, the counter x is incremented as well.The printing operation to log files blocks the rotation to avoid loss of information. If no log file is specified, all messages are printed on STDERR.
Hardware::UPS::Perl::Logging Related Software