As per the documentation the HttpClientConfigurer code is not reachable therefore UUID in the log trace is not being added. public class HttpClientConfigurer implements ElasticsearchHttpClientConfigurer {
@Overridepublic void configure(ElasticsearchHttpClientConfigurationContext context) {
HttpAsyncClientBuilder clientBuilder = context.clientBuilder();clientBuilder.addInterceptorFirst((HttpRequestInterceptor) (request, context12) -> { h1. MDC.put("correlationId", UUID.randomUUID().toString()); h1. }); h1. clientBuilder.addInterceptorFirst((HttpResponseInterceptor) (response, context1) -> { h1. MDC.put("correlationId", UUID.randomUUID().toString()); h1. });}
}
hibernate.search.backend.client.configurer =class:com.example.configuration.HttpClientConfigurerNote : MDC - > A Mapped Diagnostic Context, or MDC in short, is an instrument for distinguishing interleaved log output from different sources. Log output is typically interleaved when a server handles multiple clients near-simultaneously. MDC.put("correlationId", UUID.randomUUID().toString()); add the correlationId UUID to the logging context. Main Goal is to generate logs with UUID for better tracing |