NAME
Apache::FormatLog -- Base package to retrieve logdata for creating Apache access logs from mod_perl handlers.
SYNOPSIS
use Apache;
use Apache::FormatLog;
$lf = Apache::FormatLog->new($r);
$logdata = $lf->getLogData();
$logline = $lf->toString();
DESCRIPTION
Apache::FormatLog provides an interface to most common logdata that is used for access logs. You can use this module from mod_perl handlers. This class should always be extended, and the methods toString and write should always be overridden. Two existing FormatLog modules that use Apache::FormatLog are: Apache::FormatLog::Common and Apache::FormatLog::Combined
METHODS
new ( $requestObject )
Created a new FormatLog object. An Apache request object (see docs [1]) is expected as a parameter.
toString ( )
Return the formatted logline as a string.
getLogData ( )
Returns a hashreference with the most common data that is needed for logging. The hash reference contains the following keys:
- waittime
-
The time between the start and end of the request in seconds.
- status
-
The HTTP status code for this request.
- bytes
-
The total number of bytes sent in this request.
- browser
-
The identified User-agent
- filename
-
The filename that is returned in the request.
- referer
-
The referer page.
- remotehost
- remoteip
- remoteuser
- remotelogname
- hostname
- encoding
- language
- request
-
The first line of the full HTTP request.
- timeFormatted
-
The standard Apache formatted time (now): [dd/MM/yyyy:hh:mm::s +GMT]
- protocol
- querystring
-
The query string, without a leading ? (question mark)
- method
-
The request method as a string: "GET", "HEAD" or "POST"
SEE ALSO
perl(1), mod_perl(3), Apache(3), Apache::FormatLog::Common, Apache::FormatLog::Combined
AUTHOR
Leendert Bottelberghs <lbottel@cpan.org>
COPYRIGHT
Copyright (c) 2005, Leendert Bottelberghs. All rights reserved.
This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
REFERENCES
[1] http://search.cpan.org/~gozer/mod_perl-1.29/Apache/Apache.pm