Class AccessLogProbe
- java.lang.Object
-
- org.glassfish.grizzly.http.server.HttpServerProbe.Adapter
-
- org.glassfish.grizzly.http.server.accesslog.AccessLogProbe
-
- All Implemented Interfaces:
HttpServerProbe
public class AccessLogProbe extends HttpServerProbe.Adapter
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
Fields Modifier and Type Field Description static intDEFAULT_STATUS_THRESHOLDThe minimum response status that will trigger an entry in an access log configured by this instance (default, log everything).
-
Constructor Summary
Constructors Constructor Description AccessLogProbe(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonRequestCompleteEvent(HttpServerFilter filter, org.glassfish.grizzly.Connection connection, Response response)Receive notification of the completion of aResponsean possibly trigger an access log entry generation.voidonRequestReceiveEvent(HttpServerFilter filter, org.glassfish.grizzly.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 Detail
-
DEFAULT_STATUS_THRESHOLD
public static final int DEFAULT_STATUS_THRESHOLD
The minimum response status that will trigger an entry in an access log configured by this instance (default, log everything).- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AccessLogProbe
public AccessLogProbe(AccessLogAppender appender, AccessLogFormat format)
Create a newAccessLogProbeformatting data with the specified format and appending it to the specified appender.
-
AccessLogProbe
public AccessLogProbe(AccessLogAppender appender, AccessLogFormat format, int statusThreshold)
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 Detail
-
onRequestReceiveEvent
public void onRequestReceiveEvent(HttpServerFilter filter, org.glassfish.grizzly.Connection connection, Request request)
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, org.glassfish.grizzly.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.
-
-