public class HttpAccess extends Object
Each HttpAccess is passed to the
accessLogger
to be logged.
See toCombinedLogFormat()
and toCommonLogFormat()
for some commonly used output formats.
Modifier and Type | Field and Description |
---|---|
HttpRequest |
request
The http request.
|
HttpResponse |
response
The http response.
|
long |
responseBodySize
The response body size.
|
long |
timeRequestReceived
The time when the request is received.
|
long |
timeResponseBegins
The time when the server starts to write the response.
|
long |
timeResponseEnds
The time when the server finishes writing the response.
|
Exception |
responseError
Error occurred during writing the response; null if none.
|
Constructor and Description |
---|
HttpAccess(HttpRequest request,
HttpResponse response,
long responseBodySize,
long timeRequestReceived,
long timeResponseBegins,
long timeResponseEnds,
Exception responseError)
Create an HttpAccess instance.
|
Instance Methods | |
---|---|
CharSequence |
toCommonLogFormat()
Convert to "Common Log Format".
|
CharSequence |
toCombinedLogFormat()
Convert to "Combined Log Format".
|
public final HttpRequest request
public final HttpResponse response
public final long responseBodySize
responseError
!=null.public final long timeRequestReceived
public final long timeResponseBegins
public final long timeResponseEnds
public final Exception responseError
public HttpAccess(HttpRequest request, HttpResponse response, long responseBodySize, long timeRequestReceived, long timeResponseBegins, long timeResponseEnds, Exception responseError)
public CharSequence toCommonLogFormat()
Example:
127.0.0.1 - - [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326
public CharSequence toCombinedLogFormat()
Example:
127.0.0.1 - - [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326 "http://www.example.com/start.html" "Mozilla/4.08 [en] (Win98; I ;Nav)"