public interface IServiceMonitor
Modifier and Type | Method and Description |
---|---|
void |
beginCall(Object... parameters)
Notify of the beginning of a call to a service.
|
void |
cacheHit()
Reports that a cache system was used instead of performing the actual
call.
|
void |
context(String name,
String value) |
void |
correlationId(String correlationId) |
void |
endCall()
Notify the end of a call to a service.
|
void |
error(String message)
Reports an error : the call has succeed but returns an error (with data).
|
void |
executionTime(long timeMillis)
Manually set the execution time.
|
void |
failure(String reason)
Reports a failure : the call has failed completely
|
void |
failure(String reason,
Exception e)
Reports a failure : the call has failed completely with exception e.
|
void |
nestedCall()
Report that another service was called in order to perform original
action
|
void |
setLogFormat(String format)
Set the log message format for this monitor instance, based on :
http://commons.apache.org/lang/api-release/org/apache/commons/lang3/text/
StrSubstitutor.html
Example :
${correlationId}|${group}|${name}|${responseTime}|${cache}|${status}|${statusMessage}
Available variables :
group
name
responseTime
cache
failure
failureReason
failureException
error
errorMessage
correlationId
status : SUCCESS/FAILURE/ERROR
statusMessage : failure or error message
Any additional context values
|
void |
setLogger(org.slf4j.Logger logger)
Set the logger to use for this service call.
|
void beginCall(Object... parameters)
operationName
- operation nameparameters
- operation parametersvoid cacheHit()
void correlationId(String correlationId)
void endCall()
void error(String message)
message
- void executionTime(long timeMillis)
void failure(String reason)
reason
- void failure(String reason, Exception e)
reason
- e
- void nestedCall()
void setLogFormat(String format)
Example :
${correlationId}|${group}|${name}|${responseTime}|${cache}|${status}|${statusMessage}
Available variables :
format
- void setLogger(org.slf4j.Logger logger)
logger
- Copyright © 2010–2016. All rights reserved.