title: Set WebClient.Builder.exchangeStrategies() without losing Spring Jackson configuration
body: <p>I'm using the following code (from <a href="https://stackoverflow.com/a/47463190/159178">this answer</a>) to configure headers to be logged on WebClient requests:</p>
  
  <pre><code>ExchangeStrategies exchangeStrategies = ExchangeStrategies.withDefaults();
  exchangeStrategies
      .messageWriters().stream()
      .filter(LoggingCodecSupport.class::isInstance)
      .forEach(writer -&gt; ((LoggingCodecSupport)writer).setEnableLoggingRequestDetails(true));
  
  client = WebClient.builder()
      .exchangeStrategies(exchangeStrategies)
  </code></pre>
  
  <p>This works, but causes my Jackson configuration to be lost. In my application.properties I have:</p>
  
  <pre><code>spring.jackson.default-property-inclusion=non-null
  spring.jackson.deserialization.accept-empty-string-as-null-object=true
  </code></pre>
  
  <p>which gets overwritten by the above code. Here is my workaround:</p>
  
  <pre><code>  @Autowired ObjectMapper objectMapper;
  
    @Bean
    WebClientCustomizer webClientCustomizer() {
      return (WebClient.Builder builder) -&gt; {
        builder
            .exchangeStrategies(createExchangeStrategiesWhichLogHeaders())
      };
    }
  
    private ExchangeStrategies createExchangeStrategiesWhichLogHeaders() {
      ExchangeStrategies exchangeStrategies =
          ExchangeStrategies.builder()
              .codecs(
                  clientDefaultCodecsConfigurer -&gt; {
                    clientDefaultCodecsConfigurer
                        .defaultCodecs()
                        .jackson2JsonEncoder(
                            new Jackson2JsonEncoder(objectMapper, MediaType.APPLICATION_JSON));
                    clientDefaultCodecsConfigurer
                        .defaultCodecs()
                        .jackson2JsonDecoder(
                            new Jackson2JsonDecoder(objectMapper, MediaType.APPLICATION_JSON));
                  })
              .build();
  
      exchangeStrategies
          .messageWriters()
          .stream()
          .filter(LoggingCodecSupport.class::isInstance)
          .forEach(writer -&gt; ((LoggingCodecSupport) writer).setEnableLoggingRequestDetails(true));
  
      return exchangeStrategies;
    }
  </code></pre>
  
  <p>This works, but feels a bit strange. The question is: do I need to include the jackson/objectMapper configuration like this, or is there a simpler way to avoid the Spring objectMapper configuration being overwritten?</p>