Apache-DBILogConfig

 view release on metacpan or  search on metacpan

DBILogConfig.pm  view on Meta::CPAN

 PerlSetVar DBILogConfig_username    informix
 PerlSetVar DBILogConfig_password    informix
 PerlSetVar DBILogConfig_table	     mysite_log
 PerlSetVar DBILogConfig_log_format  "%b=bytes_sent %f=filename %h=remote_host %r=request %s=status"

=head1 DESCRIPTION

This module replicates the functionality of the standard Apache module, mod_log_config,
but logs information in a DBI-compliant database instead of a file. (Some documentation has been
borrowed from the mod_log_config documentation.)

=head1 LIST OF TOKENS

=over 4

=item DBILogConfig_data_source

A DBI data source with a format of "DBI::driver:database"

=item DBILogConfig_username

Username passed to the database driver when connecting

=item DBILogConfig_password

Password passed to the database driver when connecting

=item DBILogConfig_table

Table in the database for logging

=item DBILogConfig_log_format

A string consisting of formats separated by white space that define the data to be logged (see FORMAT STRING below)

=back

=head1 FORMAT STRING

A format string consists of a string with the following syntax:

B<%[conditions][{parameter}]format=field>

=head2 format

Formats specify the type of data to be logged. The following formats are accepted:

=over

=item a Remote IP-address

=item A Local IP-address (not yet supported)

=item B Bytes sent, excluding HTTP headers.

=item b Bytes sent, excluding HTTP headers. In CLF format
        i.e. a '-' rather than a 0 when no bytes are sent.

=item c Connection status when response is completed.
        'X' = connection aborted before the response completed.
        '+' = connection may be kept alive after the response is sent.
        '-' = connection will be closed after the response is sent.
        (not yet supported)

=item e The contents of the environment variable specified by parameter

=item f Filename

=item h Remote host

=item H The request protocol

=item i The contents of the header (specified by parameter) in the request sent to the server.

=item l Remote logname (from identd, if supplied)

=item m The request method

=item n The contents of note (specified by parameter) from another module.

=item o The contents of the header (specified by parameter) in the reply.

=item p The canonical Port of the server serving the request

=item P The process ID of the child that serviced the request.

=item q The query string (prepended with a ? if a query string exists, otherwise an empty string)

=item r First line of request

=item s Status. For requests that got internally redirected, this is the status of
        the *original* request.

=item t Time, in common log format time format or the format specified by parameter, 
        which should be in strftime(3) format.

=item T The time taken to serve the request, in seconds.

=item u Remote user (from auth; may be bogus if return status (%s) is 401)

=item U The URL path requested.

=item v The canonical ServerName of the server serving the request.

=item V The server name according to the UseCanonicalName setting (not yet supported).

=back

=head2 field

A database column to log the data to

=head2 parameter

For formats that take a parameter

Example: %{DOCUMENT_ROOT}e 

=head2 conditions

Conditions are a comma-separated list of status codes. If the status of the request being logged equals one of 



( run in 1.303 second using v1.01-cache-2.11-cpan-df04353d9ac )