NAME

Labrador::Crawler::AccessLog

SYPNOPSIS

	use Labrador::Crawler::AccessLog;
	my $logger = new Labrador::Crawler::AccessLog(data => $data);
	$logger->log();

DESCRIPTION

Customisable access logger, which when allows custom formats for log entries to be created, similar to the way Apache allows.

CONFIGURATION

SpiderAccessLog
The filename to save the Access log file to. Must be aboslute at the moment. (TODO)
SpiderAccessLogFormat
The format with which to save the log file entry.

FORMAT

%a
Remote IP address
%A
Remote hostname
%d
localtime standard date/time scalar format
%f
Filename
%p
Remote port
%T
Time taken to make request
%t
Current epoch time from time
%m
Request method
%q
Querystring
%U
Entire URL requested
%u
URI of request
%s
HTTP status code
%S
Protocol scheme (eg http, https)
%r
Referring URL
%c
Size of content downloaded uncompressed (excluding headers)
%C
Size of content downloaded compressed (excluding headers)
%P
PID of requesting crawler
%H
Hostname of the requesting crawler

METHODS

new(data=> $data)
Constuct new object
init()
Initialises this module (called by new()).
log($HTTPrequest, $HTTPresponse, \$data, $deltatime)
Log a request and response for the crawler to the log file with the configured format. NB: Contains a switch statement, so uses the Switch pragma. This must be installed. Unfortunately, the use of switch complicated debugging this module.

PRIVATE METHODS

parse()
Converts a charatcter from the log formatting into a sprintf compatable number, such that it can be found in the stack of formatting clauses values passed to sprintf.

REVISION

	$Revision: 1.5 $