...
Code Block |
---|
language | java |
---|
title | SLF4J |
---|
linenumbers | true |
---|
|
public static final LoggerMarker loggerENTRY = LoggerFactoryMarkerFactory.getLogger(this.getClass());
final Marker entry = MarkerFactory.getDetachedMarker("ENTRY"getMarker("ENTRY");
// ...
final Logger logger = LoggerFactory.getLogger(this.getClass());
logger.debug(entryENTRY, "Entering."); |
Marker - EXIT
...
Code Block |
---|
language | java |
---|
title | SLF4J |
---|
linenumbers | true |
---|
|
public static final Marker EXIT = MarkerFactory.getMarker("EXIT");
// ...
final Logger logger = LoggerFactory.getLogger(this.getClass());
final Marker entry = MarkerFactory.getDetachedMarker("EXIT");
logger.debug(entrylogger.debug(EXIT, "Exiting."); |
Marker - INVOKE
...
Code Block |
---|
language | java |
---|
title | SLF4J |
---|
linenumbers | true |
---|
|
//TODOpublic static final Marker INVOKE = MarkerFactory.getMarker("INVOKE");
// ...
final Logger logger = LoggerFactory.getLogger(this.getClass());
// ...
// Generate and report invocation ID.
final String invocationID = UUID.randomUUID().toString();
MDC.put(MDC_INVOCATION_ID, invocationID);
try {
logger.trace(INVOKE, "Invoking asynchronously... ");
}
finally {
MDC.remove(MDC_INVOCATION_ID);
}
// Pass invocationID as HTTP X-InvocationID header.
callDownstreamSystem(invocationID, ... ); |
TODO: EELF, without changing published APIs.
...