@PreMatching @Priority(value=-2147483648) public class LoggingFilter extends Object implements ContainerRequestFilter, ClientRequestFilter, ContainerResponseFilter, ClientResponseFilter, WriterInterceptor
| Constructor and Description |
|---|
LoggingFilter()
Create a logging filter logging the request and response to a default JDK
logger, named as the fully qualified class name of this class.
|
LoggingFilter(Logger logger,
boolean printEntity)
Create a logging filter with custom logger and custom settings of entity
logging.
|
LoggingFilter(Logger logger,
int maxEntitySize)
Creates a logging filter with custom logger and entity logging turned on, but potentially limiting the size
of entity to be buffered and logged.
|
| Modifier and Type | Method and Description |
|---|---|
void |
aroundWriteTo(WriterInterceptorContext writerInterceptorContext) |
void |
filter(ClientRequestContext context) |
void |
filter(ClientRequestContext requestContext,
ClientResponseContext responseContext) |
void |
filter(ContainerRequestContext context) |
void |
filter(ContainerRequestContext requestContext,
ContainerResponseContext responseContext) |
public LoggingFilter()
public LoggingFilter(Logger logger, boolean printEntity)
logger - the logger to log requests and responses.printEntity - if true, entity will be logged as well up to the default maxEntitySize, which is 8KBpublic LoggingFilter(Logger logger, int maxEntitySize)
logger - the logger to log requests and responses.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.public void filter(ClientRequestContext context) throws IOException
filter in interface ClientRequestFilterIOExceptionpublic void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException
filter in interface ClientResponseFilterIOExceptionpublic void filter(ContainerRequestContext context) throws IOException
filter in interface ContainerRequestFilterIOExceptionpublic void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException
filter in interface ContainerResponseFilterIOExceptionpublic void aroundWriteTo(WriterInterceptorContext writerInterceptorContext) throws IOException, WebApplicationException
aroundWriteTo in interface WriterInterceptorIOExceptionWebApplicationExceptionCopyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.