public class LoggingInvocationEventHandler
extends com.palantir.tritium.event.AbstractInvocationEventHandler<com.palantir.tritium.event.InvocationContext>
InvocationEventHandler that times every method invocation and logs to specified
logger.| Modifier and Type | Field and Description |
|---|---|
static com.palantir.tritium.api.functions.LongPredicate |
LOG_ALL_DURATIONS |
static com.palantir.tritium.api.functions.LongPredicate |
LOG_DURATIONS_GREATER_THAN_0_MILLIS |
static com.palantir.tritium.api.functions.LongPredicate |
LOG_DURATIONS_GREATER_THAN_1_MICROSECOND |
static com.palantir.tritium.api.functions.LongPredicate |
NEVER_LOG |
| Constructor and Description |
|---|
LoggingInvocationEventHandler(org.slf4j.Logger logger,
LoggingLevel level) |
LoggingInvocationEventHandler(org.slf4j.Logger logger,
LoggingLevel level,
com.palantir.tritium.api.functions.LongPredicate durationPredicate)
|
LoggingInvocationEventHandler(org.slf4j.Logger logger,
LoggingLevel level,
java.util.function.LongPredicate durationPredicate) |
| Modifier and Type | Method and Description |
|---|---|
void |
onFailure(com.palantir.tritium.event.InvocationContext context,
java.lang.Throwable cause) |
void |
onSuccess(com.palantir.tritium.event.InvocationContext context,
java.lang.Object result) |
com.palantir.tritium.event.InvocationContext |
preInvocation(java.lang.Object instance,
java.lang.reflect.Method method,
java.lang.Object[] args) |
public static final com.palantir.tritium.api.functions.LongPredicate LOG_ALL_DURATIONS
public static final com.palantir.tritium.api.functions.LongPredicate LOG_DURATIONS_GREATER_THAN_1_MICROSECOND
public static final com.palantir.tritium.api.functions.LongPredicate LOG_DURATIONS_GREATER_THAN_0_MILLIS
public static final com.palantir.tritium.api.functions.LongPredicate NEVER_LOG
public LoggingInvocationEventHandler(org.slf4j.Logger logger,
LoggingLevel level)
@Deprecated
public LoggingInvocationEventHandler(org.slf4j.Logger logger,
LoggingLevel level,
com.palantir.tritium.api.functions.LongPredicate durationPredicate)
LoggingInvocationEventHandler(Logger, LoggingLevel, java.util.function.LongPredicate)public LoggingInvocationEventHandler(org.slf4j.Logger logger,
LoggingLevel level,
java.util.function.LongPredicate durationPredicate)
public final com.palantir.tritium.event.InvocationContext preInvocation(@Nonnull
java.lang.Object instance,
@Nonnull
java.lang.reflect.Method method,
@Nonnull
java.lang.Object[] args)
public final void onSuccess(@Nullable
com.palantir.tritium.event.InvocationContext context,
@Nullable
java.lang.Object result)
public final void onFailure(@Nullable
com.palantir.tritium.event.InvocationContext context,
@Nonnull
java.lang.Throwable cause)