All Resources All filters

# LogFilter

The log filter purpose is to allow very detail logging of a particular area of your web server. The logs produced by this filter can be as verbose as you want (it allows you to log any request or reply field, check the request-headers and reply-headers attribute).

This filter generates a very verbose log format, consisting of a sequence of records. Each record is made of a number of lines of the following format:

    property=value

A property , whose name is always in lower case, can be either:

- The special, record delimiter url property. That property always indicate the request url, and mark the beginning of the properties logging that request.
- The request.* set of properties indicate the value of a request header field. If the log filter is configured to log, say the request referer header, then when it is available, the log filter will emit a line logging its value as request.referer.
- The reply.* set of properties are used to denote reply header values. For example, when logging the reply content-location header, the log filter will emit a line logging its value as reply.content-location.

As an example, if you configure the logger to log the Refer , User-Agent and Accept HTTP request headers, along with the Content-Length reply header, the following kind of log will be outputed:

    ...
    url=http://www43.inria.fr:8008/Admin/
    request.user-agent=Mozilla/3.0 (X11; I; SunOS 5.5 sun4u)
    request.accept=image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
    reply.content-length=908
    url=http://www43.inria.fr:8008/Admin/Properties
    request.referer=http://www43.inria.fr:8008/Admin/
    request.user-agent=Mozilla/3.0 (X11; I; SunOS 5.5 sun4u)
    request.accept=image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
    reply.content-length=615
    url=http://www43.inria.fr:8008/Admin/Properties/general
    request.referer=http://www43.inria.fr:8008/Admin/Properties
    request.user-agent=Mozilla/3.0 (X11; I; SunOS 5.5 sun4u)
    request.accept=image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
    reply.content-length=3829
    ...

This extract is made of tree record, logging a transaction on respectively http://www43.inria.fr:8008/Admin/, http://www43.inria.fr:8008/Admin/Properties and http://www43.inria.fr:8008/Admin/Properties/general.

## Inherits

The LogFilter class inherits from the following classes:

- ResourceFilter (aka abstract class)

## Attributes description

The HTTPResource defines the following attributes:

- request-headers
- reply-headers
- logfile

`request-headers`

semantics
  The list of request HTTP headers to log. All header names are to be entered in lower case, one header per line. For each entered header, an appropriate line will be added in all records, provided the requested header exists for the given transaction.
type
  This attribute is an editable StringArrayAttribute
default value
  This attribute defaults to the resource that loaded it into memory, as explained above.

reply-headers

semantics
  The list of HTTP reply headers to log. All header names are to be entered in lower case, one header per line. For each entered header, an appropriate line will be added to each log record.
type
  This attribute is an editable StringArrayAttribute
default value
  This attribute defaults to the resource that loaded it into memory, as explained above.

logfile

semantics
  The name of the file to output the log to.
type
  This attribute is an editable FileAttribute
default value
  This attribute has no default value. The log filter will not log anything until this is set to a correct file name.

Anselm Baird-Smith
$Id: w3c.jigsaw.contrib.LogFilter.html,v 1.2 1996/12/09 03:17:12 jigsaw Exp $