Apache::FormatLog -- Base package to retrieve logdata for creating Apache access logs from mod_perl handlers.
use Apache; use Apache::FormatLog; $lf = Apache::FormatLog->new($r); $logdata = $lf->getLogData(); $logline = $lf->toString();
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
Apache::FormatLog
Apache::FormatLog::Common
Apache::FormatLog::Combined
Created a new FormatLog object. An Apache request object (see docs [1]) is expected as a parameter.
Return the formatted logline as a string.
Returns a hashreference with the most common data that is needed for logging. The hash reference contains the following keys:
The time between the start and end of the request in seconds.
The HTTP status code for this request.
The total number of bytes sent in this request.
The identified User-agent
The filename that is returned in the request.
The referer page.
The first line of the full HTTP request.
The standard Apache formatted time (now): [dd/MM/yyyy:hh:mm::s +GMT]
The query string, without a leading ? (question mark)
The request method as a string: "GET", "HEAD" or "POST"
perl(1), mod_perl(3), Apache(3), Apache::FormatLog::Common, Apache::FormatLog::Combined
Leendert Bottelberghs <lbottel@cpan.org>
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.
[1] http://search.cpan.org/~gozer/mod_perl-1.29/Apache/Apache.pm
To install Apache::FormatLog, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Apache::FormatLog
CPAN shell
perl -MCPAN -e shell install Apache::FormatLog
For more information on module installation, please visit the detailed CPAN module installation guide.