@ConstrainedTo(value=SERVER) @PreMatching @Priority(value=-2147483648) final class ServerLoggingFilter extends LoggingInterceptor implements javax.ws.rs.container.ContainerRequestFilter, javax.ws.rs.container.ContainerResponseFilter
The filter is registered in LoggingFeature.configure(FeatureContext)
and can be used on server side only. The Priority
is set to the maximum value, which means that filter is called as the first filter when request arrives and similarly as the
last filter when the response is dispatched, so request and response is logged as arrives or as dispatched.
LoggingInterceptor.LoggingStream
_id, ENTITY_LOGGER_PROPERTY, level, logger, LOGGING_ID_PROPERTY, maxEntitySize, REQUEST_PREFIX, RESPONSE_PREFIX, verbosity
Constructor and Description |
---|
ServerLoggingFilter(java.util.logging.Logger logger,
java.util.logging.Level level,
LoggingFeature.Verbosity verbosity,
int maxEntitySize)
Create a logging filter with custom logger and custom settings of entity
logging.
|
Modifier and Type | Method and Description |
---|---|
void |
filter(javax.ws.rs.container.ContainerRequestContext context) |
void |
filter(javax.ws.rs.container.ContainerRequestContext requestContext,
javax.ws.rs.container.ContainerResponseContext responseContext) |
aroundWriteTo, getSortedHeaders, isReadable, log, logInboundEntity, printEntity, printPrefixedHeaders, printRequestLine, printResponseLine
public ServerLoggingFilter(java.util.logging.Logger logger, java.util.logging.Level level, LoggingFeature.Verbosity verbosity, int maxEntitySize)
logger
- the logger to log messages to.level
- level at which the messages will be logged.verbosity
- verbosity of the logged messages. See LoggingFeature.Verbosity
.maxEntitySize
- maximum number of entity bytes to be logged (and buffered) - if the entity is larger,
logging filter will print (and buffer in memory) only the specified number of bytes
and print "...more..." string at the end. Negative values are interpreted as zero.public void filter(javax.ws.rs.container.ContainerRequestContext context) throws java.io.IOException
filter
in interface javax.ws.rs.container.ContainerRequestFilter
java.io.IOException
public void filter(javax.ws.rs.container.ContainerRequestContext requestContext, javax.ws.rs.container.ContainerResponseContext responseContext) throws java.io.IOException
filter
in interface javax.ws.rs.container.ContainerResponseFilter
java.io.IOException