We are using hystrix in our spring boot application. We wants to use MDC for appending specific attributes like Request Id and Request URI and Loggedin User to every log statement. This mechanism is not working wherever hystrix is implemented.
@HystrixCommand(fallbackMethod = "callFallback", commandProperties = {
@HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "10000")}, ignoreExceptions = Exception.class)
public GenericResponse callUser(User user) {
//Implementation
log.info("Creating user called");
}
Its working perfectly fine for non hystrix annotated methods. I do understand that MDC is thread specific and hystrix does executes on seperate thread. Please suggest the work around as i can't comment the hystrix.