@Deprecated
@PreMatching
@Priority(value=-2147483648)
public final class LoggingFilter
extends java.lang.Object
implements javax.ws.rs.container.ContainerRequestFilter, javax.ws.rs.client.ClientRequestFilter, javax.ws.rs.container.ContainerResponseFilter, javax.ws.rs.client.ClientResponseFilter, javax.ws.rs.ext.WriterInterceptor
LoggingFeature
instead.Modifier and Type | Class and Description |
---|---|
private class |
LoggingFilter.LoggingStream
Deprecated.
|
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.atomic.AtomicLong |
_id
Deprecated.
|
private static java.util.Comparator<java.util.Map.Entry<java.lang.String,java.util.List<java.lang.String>>> |
COMPARATOR
Deprecated.
|
private static int |
DEFAULT_MAX_ENTITY_SIZE
Deprecated.
|
private static java.lang.String |
ENTITY_LOGGER_PROPERTY
Deprecated.
|
private java.util.logging.Logger |
logger
Deprecated.
|
private static java.util.logging.Logger |
LOGGER
Deprecated.
|
private static java.lang.String |
LOGGING_ID_PROPERTY
Deprecated.
|
private int |
maxEntitySize
Deprecated.
|
private static java.lang.String |
NOTIFICATION_PREFIX
Deprecated.
|
private boolean |
printEntity
Deprecated.
|
private static java.lang.String |
REQUEST_PREFIX
Deprecated.
|
private static java.lang.String |
RESPONSE_PREFIX
Deprecated.
|
Constructor and Description |
---|
LoggingFilter()
Deprecated.
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(java.util.logging.Logger logger,
boolean printEntity)
Deprecated.
Create a logging filter with custom logger and custom settings of entity
logging.
|
LoggingFilter(java.util.logging.Logger logger,
int maxEntitySize)
Deprecated.
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(javax.ws.rs.ext.WriterInterceptorContext writerInterceptorContext)
Deprecated.
|
void |
filter(javax.ws.rs.client.ClientRequestContext context)
Deprecated.
|
void |
filter(javax.ws.rs.client.ClientRequestContext requestContext,
javax.ws.rs.client.ClientResponseContext responseContext)
Deprecated.
|
void |
filter(javax.ws.rs.container.ContainerRequestContext context)
Deprecated.
|
void |
filter(javax.ws.rs.container.ContainerRequestContext requestContext,
javax.ws.rs.container.ContainerResponseContext responseContext)
Deprecated.
|
private java.util.Set<java.util.Map.Entry<java.lang.String,java.util.List<java.lang.String>>> |
getSortedHeaders(java.util.Set<java.util.Map.Entry<java.lang.String,java.util.List<java.lang.String>>> headers)
Deprecated.
|
private void |
log(java.lang.StringBuilder b)
Deprecated.
|
private java.io.InputStream |
logInboundEntity(java.lang.StringBuilder b,
java.io.InputStream stream,
java.nio.charset.Charset charset)
Deprecated.
|
private java.lang.StringBuilder |
prefixId(java.lang.StringBuilder b,
long id)
Deprecated.
|
private void |
printPrefixedHeaders(java.lang.StringBuilder b,
long id,
java.lang.String prefix,
javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> headers)
Deprecated.
|
private void |
printRequestLine(java.lang.StringBuilder b,
java.lang.String note,
long id,
java.lang.String method,
java.net.URI uri)
Deprecated.
|
private void |
printResponseLine(java.lang.StringBuilder b,
java.lang.String note,
long id,
int status)
Deprecated.
|
private static final java.util.logging.Logger LOGGER
private static final java.lang.String NOTIFICATION_PREFIX
private static final java.lang.String REQUEST_PREFIX
private static final java.lang.String RESPONSE_PREFIX
private static final java.lang.String ENTITY_LOGGER_PROPERTY
private static final java.lang.String LOGGING_ID_PROPERTY
private static final java.util.Comparator<java.util.Map.Entry<java.lang.String,java.util.List<java.lang.String>>> COMPARATOR
private static final int DEFAULT_MAX_ENTITY_SIZE
private final java.util.logging.Logger logger
private final java.util.concurrent.atomic.AtomicLong _id
private final boolean printEntity
private final int maxEntitySize
public LoggingFilter()
public LoggingFilter(java.util.logging.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(java.util.logging.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. Negative values are interpreted as zero.private void log(java.lang.StringBuilder b)
private java.lang.StringBuilder prefixId(java.lang.StringBuilder b, long id)
private void printRequestLine(java.lang.StringBuilder b, java.lang.String note, long id, java.lang.String method, java.net.URI uri)
private void printResponseLine(java.lang.StringBuilder b, java.lang.String note, long id, int status)
private void printPrefixedHeaders(java.lang.StringBuilder b, long id, java.lang.String prefix, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> headers)
private java.util.Set<java.util.Map.Entry<java.lang.String,java.util.List<java.lang.String>>> getSortedHeaders(java.util.Set<java.util.Map.Entry<java.lang.String,java.util.List<java.lang.String>>> headers)
private java.io.InputStream logInboundEntity(java.lang.StringBuilder b, java.io.InputStream stream, java.nio.charset.Charset charset) throws java.io.IOException
java.io.IOException
public void filter(javax.ws.rs.client.ClientRequestContext context) throws java.io.IOException
filter
in interface javax.ws.rs.client.ClientRequestFilter
java.io.IOException
public void filter(javax.ws.rs.client.ClientRequestContext requestContext, javax.ws.rs.client.ClientResponseContext responseContext) throws java.io.IOException
filter
in interface javax.ws.rs.client.ClientResponseFilter
java.io.IOException
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
public void aroundWriteTo(javax.ws.rs.ext.WriterInterceptorContext writerInterceptorContext) throws java.io.IOException, javax.ws.rs.WebApplicationException
aroundWriteTo
in interface javax.ws.rs.ext.WriterInterceptor
java.io.IOException
javax.ws.rs.WebApplicationException