Technical data

7 Configuring WebLogic Server Web Components
7-18 Configuring and Managing WebLogic Server
cs-uri-query
Only the query portion of the URI. This field has type <uri>, as defined in the
W3C specification.
Creating Custom Field Identifiers
You can also create user-defined fields for inclusion in an HTTP access log file that
uses the extended log format. To create a custom field you identify the field in the ELF
log file using the
Fields directive and then you create a matching Java class that
generates the desired output. You can create a separate Java class for each field, or the
Java class can output multiple fields. A sample of the Java source for such a class is
included in this document. See “Java Class for Creating a Custom ELF Field” on page
7-22.
To create a custom field:
1. Include the field name in the
Fields directive, using the form:
x-myCustomField.
Where
myCustomField is a fully-qualified class name.
For more information on the
Fields directive, see “Creating the Fields
Directive” on page 7-16.
2. Create a Java class with the same fully-qualified class name as the custom field
you defined with the
Fields directive (for example myCustomField). This class
defines the information you want logged in your custom field. The Java class
must implement the following interface:
weblogic.servlet.logging.CustomELFLogger
In your Java class, you must implement the logField() method, which takes a
HttpAccountingInfo object and FormatStringBuffer object as its
arguments:
" Use the HttpAccountingInfo object to access HTTP request and response
data that you can output in your custom field. Getter methods are provided to
access this information. For a complete listing of these get methods, see “Get
Methods of the HttpAccountingInfo Object” on page 7-19.
" Use the FormatStringBuffer class to create the contents of your custom
field. Methods are provided to create suitable output. For more information
on these methods, see the Javadocs for FormatStringBuffer (see