private void extractHeaders ( final HttpRequest httpRequest ) { if ( headersToAddToLoggingMappingDiagnosticsContext . size ( ) > 0 ) { final MultiMap < String , String > headers = httpRequest . getHeaders ( ) ; headersToAddToLoggingMappingDiagnosticsContext . forEach ( header -> { String value = headers . getFirst ( header ) ; if ( ! Str . isEmpty ( value ) ) { MDC . put ( REQUEST_HEADER_PREFIX + header , value ) ; } } ) ; } }
Extract headersToAddToLoggingMappingDiagnosticsContext data and put them into the logging mapping diagnostics context .