Log::Common

Logs messages in the httpd access and error log styles
Download

Log::Common Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Martin Hamilton
  • Publisher web site:
  • http://search.cpan.org/~mhamilton/

Log::Common Tags


Log::Common Description

Logs messages in the httpd access and error log styles Log::Common is a Perl module that defines two methods which may be used to write messages to httpd common log file style access and error log files, such as those maintained by the Apache and NCSA WWW servers. The log file is locked whilst being written to avoid corruption when multiple processes attempt to write to the same file at the same time. For convenience both methods support a parameter which, if specified, results in "exit" being called to bomb out of the program.If the environmental variable GATEWAY_INTERFACE isn't set, error messages are also sent to STDERR - though this behaviour can be overridden if undesired. This is so that Perl programs which use this class can trivially dump out messages both to their end user and to a system log file at the same time.Error log file entries are written with a leading UTC timestamp, in the common HTTP server usage.SYNOPSIS use Log::Common; $l = new Log::Common(access => "/var/log/search-hits", error => "/usr/local/log/error_log", no_stderr => 1, class => "debug"); $l->error(message => "Uh-oh... :-(", fatal => 1); $l->access(user => "martin", message => "$query_string", code => 200); Requirements: · Perl


Log::Common Related Software