Log camel exchange body as string using log4j
<p>I'm trying to log exchange body as a string using log4j.</p>

<pre><code>&lt;convertBodyTo id="_convertBodyTo1" type="java.lang.String"/&gt;
&lt;to id="_to1" uri="log:com.javarticles?level=INFO"/&gt;
</code></pre>

<p>but it's not logging as string</p>

<pre><code>15:09:05,403 | INFO  | qtp938841692-57  | javarticles                      |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | 
Exchange[ExchangePattern: InOut, BodyType: java.lang.String, Body: 
org.apache.cxf.jaxrs.impl.HttpHeadersImpl@52767902]
</code></pre>

<p>Do we have to make extra logic to log exchange body? And how do we log http headers?</p>