code: public static void logResponse(
              Logger logger, RequestLog log, LogLevel requestLogLevel,
              Function<? super HttpHeaders, ? extends HttpHeaders> requestHeadersSanitizer,
              Function<Object, ?> requestContentSanitizer,
              Function<? super HttpHeaders, ? extends HttpHeaders> requestTrailersSanitizer,
              LogLevel successfulResponseLogLevel,
              LogLevel failedResponseLogLevel,
              Function<? super HttpHeaders, ? extends HttpHeaders> responseHeadersSanitizer,
              Function<Object, ?> responseContentSanitizer,
              Function<? super HttpHeaders, ? extends HttpHeaders> responseTrailersSanitizer,
              Function<? super Throwable, ? extends Throwable> responseCauseSanitizer) {
  
          final Throwable responseCause = log.responseCause();
          final LogLevel level = responseCause == null ? successfulResponseLogLevel
                                                       : failedResponseLogLevel;
          if (level.isEnabled(logger)) {
              final String responseStr = log.toStringResponseOnly(responseHeadersSanitizer,
                                                                  responseContentSanitizer,
                                                                  responseTrailersSanitizer);
              if (responseCause == null) {
                  level.log(logger, RESPONSE_FORMAT, responseStr);
              } else {
                  if (!requestLogLevel.isEnabled(logger)) {
                      // Request wasn't logged but this is an unsuccessful response, log the request too to help
                      // debugging.
                      level.log(logger, REQUEST_FORMAT, log.toStringRequestOnly(requestHeadersSanitizer,
                                                                                requestContentSanitizer,
                                                                                requestTrailersSanitizer));
                  }
  
                  final Throwable sanitizedResponseCause = responseCauseSanitizer.apply(responseCause);
                  if (sanitizedResponseCause != null) {
                      level.log(logger, RESPONSE_FORMAT, responseStr, sanitizedResponseCause);
                  } else {
                      level.log(logger, RESPONSE_FORMAT, responseStr);
                  }
              }
          }
      }
docs: Logs a stringified response of {@link RequestLog}.