Log service
Introduction
The log service provides access to logging service. The implementation is fully based on the standard logging mechanism introduced in JDK 1.4.
Being able to properly log the activity of a Web application is a common requirement. Restlet Components know by default how to generate Apache-like logs or even custom ones. By taking advantage of the logging facility built in the JDK, the logger can be configured like any standard JDK log to filter messages, reformat them or specify where to send them. Rotation of logs is also supported; see the java.util.logging package for details.
Note that you can customize the logger name given to the java.util.logging framework by modifying the Component's "logService" property. In order to fully configure the logging, you need to declare a configuration file by setting a system property like:
System.setProperty("java.util.logging.config.file", "/your/path/logging.config");
For details on the configuration file format, please check the JDK's LogManager class. You can also have a look at the Restlet 2.0 logging documentation.
Default access log format
The default format follows the W3C Extended Log File Format with the following fields used:
- Date (YYYY-MM-DD)
- Time (HH:MM:SS)
- Client address (IP)
- Remote user identifier (see RFC 1413)
- Server address (IP)
- Server port
- Method (GET|POST|...)
- Resource reference path (including the leading slash)
- Resource reference query (excluding the leading question mark)
- Response status code
- Number of bytes sent
- Number of bytes received
- Time to serve the request (in milliseconds)
- Host reference
- Client agent name
- Referrer reference
If you use Analog to generate your log reports, and if you use the default log format, then you can simply specify this string as a value of the LOGFORMAT command: (%Y-%m-%d\t%h:%n:%j\t%S\t%u\t%j\t%j\t%j\t%r\t%q\t%c\t%b\t%j\t%T\t%v\t%B\t%f)
For custom access log format, see the syntax to use and the list of available variable names in Template.


There are no comments.