generated from 2martens/template-service
Removed return value from set method
This commit is contained in:
parent
9a88ef34b2
commit
3f2e2aaef3
|
@ -39,14 +39,12 @@ public class TraceIdInterceptor extends HandlerInterceptorAdapter
|
||||||
* A failsafe method to set a TraceId to the MDC.
|
* A failsafe method to set a TraceId to the MDC.
|
||||||
*
|
*
|
||||||
* @param traceId should be a traceId, if it is null or empty a new one will be created.
|
* @param traceId should be a traceId, if it is null or empty a new one will be created.
|
||||||
* @return the traceId param, or a new one, if it was empty
|
|
||||||
*/
|
*/
|
||||||
public String setOrCreateTraceId(String traceId) {
|
public void setOrCreateTraceId(String traceId) {
|
||||||
if (traceId == null || traceId.trim().isEmpty()) {
|
if (traceId == null || traceId.trim().isEmpty()) {
|
||||||
traceId = UUID.randomUUID().toString();
|
traceId = UUID.randomUUID().toString();
|
||||||
}
|
}
|
||||||
MDC.put(LOGGER_TRACE_ID, traceId);
|
MDC.put(LOGGER_TRACE_ID, traceId);
|
||||||
return traceId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue