title: How to mask the userName and password in requestBody logs
body: <p>Below is my request body xml and I am making rest call with this request. Having custom LoggingInterceptor to log the request and response. I want to mask the user and password in logs. </p>
  
  <p><code>&lt;login&gt;&lt;credentials user="user" Password="pass"/&gt;&lt;/login&gt;</code></p>
  
  <pre><code>     private void traceRequest(final HttpRequest request, final byte[] body) throws IOException {
          logger.trace(
              String.format(
                  "REQUEST uri=%s, method=%s, requestBody=%s",
                  request.getURI(),
                  request.getMethod(),
                  new String(body, "UTF-8")));
      }
  </code></pre>
  
  <p>Currently I am printing my logs like below:</p>
  
  <p><code>LoggingRequestInterceptor - REQUEST uri=http://localhost:8080/, method=POST, requestBody=&lt;login&gt;&lt;credentials user="user" Password="pass"/&gt;&lt;/login&gt;</code></p>
  
  <p>Below is my logback.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration scan="true" scanPeriod="30 seconds"&gt;
  
      &lt;property name="logFile" value="logs/employee.log" /&gt;
      &lt;property name="logFile-WS" value="logs/employee-ws.log" /&gt;
  
  
      &lt;appender name="employee" class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
          &lt;file&gt;${logFile}&lt;/file&gt;
          &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
              &lt;fileNamePattern&gt;${logFile}.%d{yyyy-MM-dd}.gz&lt;/fileNamePattern&gt;
              &lt;maxHistory&gt;30&lt;/maxHistory&gt;
          &lt;/rollingPolicy&gt;
          &lt;encoder&gt;
              &lt;pattern&gt;%d [%thread] %-5level %logger{64} - %msg%n&lt;/pattern&gt;
          &lt;/encoder&gt;
      &lt;/appender&gt;
  
      &lt;appender name="mainAppender" class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
          &lt;file&gt;${logFile-WS}&lt;/file&gt;
          &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
              &lt;fileNamePattern&gt;${logFile-WS}.%d{yyyy-MM-dd}.gz&lt;/fileNamePattern&gt;
              &lt;maxHistory&gt;30&lt;/maxHistory&gt;
          &lt;/rollingPolicy&gt;
          &lt;encoder&gt;
              &lt;pattern&gt;%d [%thread] %-5level %logger{64} - %replace(%msg){'having masking logic for other property'}%n&lt;/pattern&gt;
          &lt;/encoder&gt;
      &lt;/appender&gt;
      &lt;appender name="stdout" class="ch.qos.logback.core.ConsoleAppender"&gt;
          &lt;encoder&gt;
              &lt;pattern&gt;%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n&lt;/pattern&gt;
          &lt;/encoder&gt;
      &lt;/appender&gt;
      &lt;logger name="org.springframework.ws.client.MessageTracing" level="TRACE" additivity="false"&gt;
          &lt;appender-ref ref="mainAppender" /&gt;
      &lt;/logger&gt;
  
      &lt;logger name="org.springframework.ws.server.MessageTracing" level="TRACE" additivity="false"&gt;
          &lt;appender-ref ref="mainAppender" /&gt;
      &lt;/logger&gt;
  
      &lt;logger name="com.employee.LoggingRequestInterceptor" level="TRACE" additivity="false"&gt;
          &lt;appender-ref ref="mainAppender" /&gt;
      &lt;/logger&gt;
  
  
      &lt;root level="${root-log-level:-INFO}"&gt;
          &lt;appender-ref ref="stdout"/&gt;
          &lt;appender-ref ref="mainAppender"/&gt;
      &lt;/root&gt;
  &lt;/configuration&gt;
  
  </code></pre>
  
  <p>Please someone help me to solve this. Note: I am using spring boot 2 and slf4j logger</p>