|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glassfish.jersey.message.internal.TracingLogger
public abstract class TracingLogger
Low level Tracing support API. Use one instance per request.
Nested Class Summary | |
---|---|
static interface |
TracingLogger.Event
Type of event. |
static class |
TracingLogger.Level
Level of tracing message. |
Field Summary | |
---|---|
static TracingLogger.Level |
DEFAULT_LEVEL
Default event level. |
static String |
HEADER_ACCEPT
Request header name to switch on request tracing. |
static String |
HEADER_LOGGER
Request header name to set JDK logger name suffix to identify a request logs. |
static String |
HEADER_THRESHOLD
Request header name to change application default tracing level. |
static String |
PROPERTY_NAME
TracingLogger instance is placed in request context properties under this name. |
Constructor Summary | |
---|---|
TracingLogger()
|
Method Summary | |
---|---|
static TracingLogger |
create(TracingLogger.Level threshold,
String loggerNameSuffix)
Create new Tracing logger. |
static TracingLogger |
empty()
Get an empty (no-op) tracing logger instance. |
abstract void |
flush(MultivaluedMap<String,Object> headers)
Stores collected tracing messages to response HTTP header. |
static TracingLogger |
getInstance(PropertiesDelegate propertiesDelegate)
Returns instance of TracingLogger associated with current request processing
(propertiesDelegate ). |
abstract boolean |
isLogEnabled(TracingLogger.Event event)
Test if a tracing support is enabled (according to propertiesDelegate setting) and
if event can be logged (according to event.level and threshold level set). |
abstract void |
log(TracingLogger.Event event,
Object... args)
Try to log event according to event level and request context threshold level setting. |
abstract void |
logDuration(TracingLogger.Event event,
long fromTimestamp,
Object... args)
Try to log event according to event level and request context threshold level setting. |
abstract long |
timestamp(TracingLogger.Event event)
If logging support is switched on for current request and event setting the method returns current timestamp in nanos. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROPERTY_NAME
TracingLogger
instance is placed in request context properties under this name.
public static final String HEADER_THRESHOLD
public static final String HEADER_ACCEPT
public static final String HEADER_LOGGER
public static final TracingLogger.Level DEFAULT_LEVEL
Constructor Detail |
---|
public TracingLogger()
Method Detail |
---|
public static TracingLogger getInstance(PropertiesDelegate propertiesDelegate)
TracingLogger
associated with current request processing
(propertiesDelegate
).
propertiesDelegate
- request associated runtime properties. Can be null
if not running on server side.
TracingLogger
from propertiesDelegate
. Does not return null
.public static TracingLogger create(TracingLogger.Level threshold, String loggerNameSuffix)
threshold
- tracing level threshold.loggerNameSuffix
- tracing logger name suffix.
public static TracingLogger empty()
public abstract boolean isLogEnabled(TracingLogger.Event event)
propertiesDelegate
setting) and
if event
can be logged (according to event.level
and threshold level set).
event
- event type to be tested
true
if event
can be loggedpublic abstract void log(TracingLogger.Event event, Object... args)
event
- event type to be loggedargs
- message arguments (in relation to TracingLogger.Event.messageFormat()
public abstract void logDuration(TracingLogger.Event event, long fromTimestamp, Object... args)
fromTimestamp
is not set (i.e. -1
) then duration of event
is 0
.
event
- event type to be loggedfromTimestamp
- logged event is running from the timestamp in nanos. -1
in case event has no durationargs
- message arguments (in relation to TracingLogger.Event.messageFormat()
public abstract long timestamp(TracingLogger.Event event)
event
- event type to be logged
-1
if tracing is not enabledpublic abstract void flush(MultivaluedMap<String,Object> headers)
headers
- message headers.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |