Class AccessLogProbe
java.lang.Object
org.glassfish.grizzly.http.server.HttpServerProbe.Adapter
org.glassfish.grizzly.http.server.accesslog.AccessLogProbe
- All Implemented Interfaces:
HttpServerProbe
A Grizzly probe used to provide access logs generation.
- Author:
- Pier Fumagalli, USRZ.com
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.glassfish.grizzly.http.server.HttpServerProbe
HttpServerProbe.Adapter -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe minimum response status that will trigger an entry in an access log configured by this instance (default, log everything). -
Constructor Summary
ConstructorsConstructorDescriptionAccessLogProbe(AccessLogAppender appender, AccessLogFormat format) Create a newAccessLogProbeformatting data with the specified format and appending it to the specified appender.AccessLogProbe(AccessLogAppender appender, AccessLogFormat format, int statusThreshold) Create a newAccessLogProbeformatting data with the specified format and appending it to the specified appender. -
Method Summary
Modifier and TypeMethodDescriptionvoidonRequestCompleteEvent(HttpServerFilter filter, Connection connection, Response response) Receive notification of the completion of aResponsean possibly trigger an access log entry generation.voidonRequestReceiveEvent(HttpServerFilter filter, Connection connection, Request request) Instrument the specifiedRequestwith an attribute marking its received time (in nanoseconds).Methods inherited from class org.glassfish.grizzly.http.server.HttpServerProbe.Adapter
onBeforeServiceEvent, onRequestCancelEvent, onRequestResumeEvent, onRequestSuspendEvent, onRequestTimeoutEvent
-
Field Details
-
DEFAULT_STATUS_THRESHOLD
public static final int DEFAULT_STATUS_THRESHOLDThe minimum response status that will trigger an entry in an access log configured by this instance (default, log everything).- See Also:
-
-
Constructor Details
-
AccessLogProbe
Create a newAccessLogProbeformatting data with the specified format and appending it to the specified appender. -
AccessLogProbe
Create a newAccessLogProbeformatting data with the specified format and appending it to the specified appender.Only responses with status over the specified threshold will be logged, for example a threshold of
500will only generate log entries for requests that terminated in error.
-
-
Method Details
-
onRequestReceiveEvent
Instrument the specifiedRequestwith an attribute marking its received time (in nanoseconds).- Specified by:
onRequestReceiveEventin interfaceHttpServerProbe- Overrides:
onRequestReceiveEventin classHttpServerProbe.Adapter- Parameters:
filter-HttpServerFilter, the event belongs to.connection-Connection, the event belongs to.request- receivedRequest.
-
onRequestCompleteEvent
public void onRequestCompleteEvent(HttpServerFilter filter, Connection connection, Response response) Receive notification of the completion of aResponsean possibly trigger an access log entry generation.- Specified by:
onRequestCompleteEventin interfaceHttpServerProbe- Overrides:
onRequestCompleteEventin classHttpServerProbe.Adapter- Parameters:
filter-HttpServerFilter, the event belongs to.connection-Connection, the event belongs to.response- sentResponse.
-