title: log4j and XML content
body: <p>I am using log4j to log request/response XMLs sent by my application.</p>
  
  <p>The problem is that the xml contents are getting logged with newlines. 
  Any suggestions as to how to format so as to preserve the xml structure as it is received??</p>
  
  <p>Following is my appender:</p>
  
  <pre><code>&lt;appender name="xmlFileAppender" class="org.apache.log4j.RollingFileAppender"&gt;
     &lt;param name="File" value="d:/LOG/log4j/appName_${weblogic.Name}_XMLS.log" /&gt;
     &lt;param name="Append" value="true" /&gt;
     &lt;rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy"&gt;
         &lt;param name="ActiveFileName" value="d:/LOG/log4j/appName_${weblogic.Name}_XMLS.log" /&gt;
         &lt;param name="FileNamePattern" value="d:/LOG/log4j/appName_${weblogic.Name}_XMLS.%d.log.gz" /&gt;
     &lt;/rollingPolicy&gt;
     &lt;layout class="org.apache.log4j.PatternLayout"&gt;
     &lt;param name="ConversionPattern" value="[%d{DATE}][%-p][%c{3}%x][%m]%n"/&gt;
     &lt;/layout&gt;
  &lt;/appender&gt;
  </code></pre>