You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bu...@apache.org on 2017/01/06 18:20:30 UTC

svn commit: r1004293 [3/3] - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache log.html

Modified: websites/production/camel/content/log.html
==============================================================================
--- websites/production/camel/content/log.html (original)
+++ websites/production/camel/content/log.html Fri Jan  6 18:20:30 2017
@@ -85,68 +85,80 @@
 	<tbody>
         <tr>
         <td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2 id="Log-LogComponent">Log Component</h2><p>The <strong>log:</strong> component logs message exchanges to the underlying logging mechanism.</p><p>Camel uses <a shape="rect" class="external-link" href="http://www.slf4j.org/" rel="nofollow">sfl4j</a> which allows you to configure logging via, among others:
+<div class="wiki-content maincontent"><h2 id="Log-LogComponent">Log Component</h2><p>The <strong><code>log:</code></strong> component logs message exchanges to the underlying logging mechanism.</p><p>Camel uses <a shape="rect" class="external-link" href="http://www.slf4j.org/" rel="nofollow">sfl4j</a> which allows you to configure logging via, among others:
 </p><ul><li><a shape="rect" class="external-link" href="http://logging.apache.org/log4j/">Log4j</a></li><li><a shape="rect" class="external-link" href="http://logback.qos.ch/" rel="nofollow">Logback</a></li><li><a shape="rect" class="external-link" href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/package-summary.html" rel="nofollow">JDK Util Logging logging</a></li></ul><h3 id="Log-URIformat">URI format</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[log:loggingCategory[?options]
 ]]></script>
-</div></div><p>Where <strong>loggingCategory</strong> is the name of the logging category to use. You can append query options to the URI in the following format, <code>?option=value&amp;option=value&amp;...</code></p><div class="confluence-information-macro confluence-information-macro-information"><p class="title">Using Logger instance from the the Registry</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>As of <strong>Camel 2.12.4/2.13.1</strong>, if there's single instance of&#160;<code>org.slf4j.Logger</code> found in the Registry, the <strong>loggingCategory</strong> is no longer used to create logger instance. The registered instance is used instead. Also it is possible to reference particular&#160;<code>Logger</code> instance using&#160;<code>?logger=#myLogger</code> URI parameter. Eventually, if there's no registered and URI&#160;<code>logger</code> parameter, the logger ins
 tance is created using <strong>loggingCategory</strong>.</p></div></div><p>For example, a log endpoint typically specifies the logging level using the <code>level</code> option, as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>Where&#160;<strong><code>loggingCategory</code></strong> is the name of the logging category to use. You can append query options to the URI in the following format, <strong><code>?option=value&amp;option=value&amp;...</code></strong></p><div class="confluence-information-macro confluence-information-macro-information"><p class="title">Using Logger instance from the the Registry</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>As of <strong>Camel 2.12.4/2.13.1</strong>, if there's single instance of&#160;<strong><code>org.slf4j.Logger</code></strong> found in the Registry, the&#160;<strong><code>loggingCategory</code></strong> is no longer used to create logger instance. The registered instance is used instead. Also it is possible to reference particular&#160;<strong><code>Logger</code></strong> instance using&#160;<strong><code>?logger=#myLogger</code></strong> URI pa
 rameter. Eventually, if there's no registered and URI&#160;<strong><code>logger</code></strong> parameter, the logger instance is created using <strong><code>loggingCategory</code></strong>.</p></div></div><p>For example, a log endpoint typically specifies the logging level using the <strong><code>level</code></strong> option, as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[log:org.apache.camel.example?level=DEBUG
 ]]></script>
-</div></div><p>The default logger logs every exchange (<em>regular logging</em>). But Camel also ships with the <code>Throughput</code> logger, which is used whenever the <code>groupSize</code> option is specified.</p><div class="confluence-information-macro confluence-information-macro-tip"><p class="title">Also a log in the DSL</p><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>There is also a <code>log</code> directly in the DSL, but it has a different purpose. Its meant for lightweight and human logs. See more details at <a shape="rect" href="logeip.html">LogEIP</a>.</p></div></div><h3 id="Log-Options">Options</h3><div class="confluenceTableSmall"><div class="table-wrap">
- <table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Option </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Default </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Type </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>level</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>INFO</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>String</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Logging level to use. Possible values: <code>ERROR</code>, <code>WARN</code>, <code>INFO</code>, <code>DEBUG</code>, <code>TRACE</code>, <code>OFF</code> </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>marker</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1" class="
 confluenceTd"><p> <code>String</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel 2.9:</strong> An optional <a shape="rect" class="external-link" href="http://www.slf4j.org/api/org/slf4j/Marker.html" rel="nofollow">Marker</a> name to use. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>groupSize</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>Integer</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> An integer that specifies a group size for throughput logging.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>groupInterval</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>Integer</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> If specified will grou
 p message stats by this time interval (in millis) </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>groupDelay</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>0</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>Integer</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Set the initial delay for stats (in millis) </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>groupActiveOnly</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>true</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>boolean</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> If true, will hide stats when no new messages have been received for a time interval, if false, show stats regardless of message traffic </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>logger</code> </p></td><td colspan="1" rowspan=
 "1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>Logger</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel 2.12.4/2.13.1:</strong> An optional reference to <a shape="rect" class="external-link" href="http://www.slf4j.org/api/org/slf4j/Logger.html" rel="nofollow">org.slf4j.Logger</a> from Registry to use. </p></td></tr></tbody></table>
-</div></div><p><strong>note</strong>: groupDelay and groupActiveOnly are only applicable when using groupInterval</p><h3 id="Log-Formatting">Formatting</h3><p>The log formats the execution of exchanges to log lines. <br clear="none"> By default, the log uses <code>LogFormatter</code> to format the log output, where <code>LogFormatter</code> has the following options:</p><div class="confluenceTableSmall"><div class="table-wrap">
- <table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Option </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Default </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>showAll</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Quick option for turning all options on. (multiline, maxChars has to be manually set if to be used) </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>showExchangeId</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Show the unique exchange ID. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>showExchangePattern</code> </p></td><td colspan="1" rowspan="1" cla
 ss="confluenceTd"><p> <code>true</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Shows the Message Exchange Pattern (or MEP for short). </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>showProperties</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Show the exchange properties. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>showHeaders</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Show the In message headers. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>skipBodyLineSeparator</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>true</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel 2.12.2:</strong> Whether to skip line 
 separators when logging the message body. This allows to log the message body in one line, setting this option to <code>false</code> will preserve any line separators from the body, which then will log the body <em>as is</em>. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>showBodyType</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>true</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Show the In body Java type. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>showBody</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>true</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Show the In body. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>showOut</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> If the exchange
  has an Out message, show the Out message. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>showException</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> If the exchange has an exception, show the exception message (no stack trace). </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>showCaughtException</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> If the exchange has a caught exception, show the exception message (no stack trace). A caught exception is stored as a property on the exchange (using the key <code>Exchange.EXCEPTION_CAUGHT</code>) and for instance a <code>doCatch</code> can catch exceptions. See <a shape="rect" href="try-catch-finally.html">Try Catch Finally</a>. </p></td></tr><tr><td colspan="1" rowspan="1" class="
 confluenceTd"><p> <code>showStackTrace</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Show the stack trace, if an exchange has an exception. Only effective if one of <code>showAll</code>, <code>showException</code> or <code>showCaughtException</code> are enabled. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>showFiles</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel 2.9:</strong> Whether Camel should show file bodies or not (eg such as java.io.File). </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>showFuture</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Whether Camel should show <code>java.util.concurrent.Fu
 ture</code> bodies or not. If enabled Camel could potentially wait until the <code>Future</code> task is done. Will by default not wait. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>showStreams</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel 2.8:</strong> Whether Camel should show stream bodies or not (eg such as java.io.InputStream). Beware if you enable this option then you may not be able later to access the message body as the stream have already been read by this logger. To remedy this you will have to use <a shape="rect" href="stream-caching.html">Stream Caching</a>. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>multiline</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> If <code>true</code>, each piece
  of information is logged on a new line. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>maxChars</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Limits the number of characters logged per line. The default value is <code>10000</code> from <strong>Camel 2.9</strong> onwards. </p></td></tr></tbody></table>
-</div></div><div class="confluence-information-macro confluence-information-macro-tip"><p class="title">Logging stream bodies</p><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>For older versions of Camel that do not support the showFiles or showStreams properties above, you can set the following property instead on the <a shape="rect" href="camelcontext.html">CamelContext</a> to log both stream and file bodies:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>The default logger logs every exchange (<em>regular logging</em>). But Camel also ships with the <strong><code>Throughput</code></strong> logger, which is used whenever the <strong><code>groupSize</code></strong> option is specified.</p><div class="confluence-information-macro confluence-information-macro-tip"><p class="title">Also a log in the DSL</p><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>There is also a <strong><code>log</code></strong> directly in the DSL, but it has a different purpose. Its meant for lightweight and human logs. See more details at <a shape="rect" href="logeip.html">LogEIP</a>.</p></div></div><h3 id="Log-Options">Options</h3><div class="confluenceTableSmall"><div class="table-wrap">
+ <table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Option</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>groupActiveOnly</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>boolean</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If <strong><code>true</code></strong>, will hide stats when no new messages have been received for a time interval.</p><p>If <strong><code>false</code></strong>, show stats regardless of message traffic</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>groupDelay</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0</code></p
 ></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Integer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Set the initial delay for stats (in millis)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>groupInterval</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Integer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If specified will group message stats by this time interval (in millis)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>groupSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Integer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>An integer that specifies a group size for throughput logging.</p></td></tr><tr><td colspan="1" rowspan="1" class="c
 onfluenceTd"><p><code>level</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>INFO</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Logging level to use. Possible values: <strong><code>ERROR</code>, <code>WARN</code></strong>, <strong><code>INFO</code></strong>, <strong><code>DEBUG</code>, <code>TRACE</code></strong>, <strong><code>OFF</code></strong></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>logger</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Logger</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12.4/2.13.1:</strong> An optional reference to <strong><code>org.slf4j.Logger</code></strong> from Registry to use.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>marker</code></p></
 td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong> An optional <a shape="rect" class="external-link" href="http://www.slf4j.org/api/org/slf4j/Marker.html" rel="nofollow">Marker</a> name to use.</p></td></tr></tbody></table>
+</div></div><p>&#160;</p><p><strong><br clear="none"></strong></p><div class="confluence-information-macro confluence-information-macro-tip"><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p><strong><code>groupDelay</code></strong> and&#160;<strong><code>groupActiveOnly</code></strong> are only applicable when using <strong><code>groupInterval</code></strong>.</p></div></div><p>&#160;</p><h3 id="Log-Formatting">Formatting</h3><p>The log formats the execution of exchanges to log lines.&#160;</p><p>By default, the log uses <strong><code>LogFormatter</code></strong> to format the log output, where <strong><code>LogFormatter</code></strong> has the following options:</p><div class="confluenceTableSmall"><div class="table-wrap">
+ <table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Option</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>maxChars</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Limits the number of characters logged per line. The default value, from <strong>Camel 2.9</strong> is <strong><code>10000</code></strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>multiline</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If <strong><code>true</code></strong>, each piece of information is logged on a new line.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>s
 howAll</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Quick option for turning all options on. (<strong><code>multiline</code></strong>,&#160;<strong><code>maxChars</code></strong> has to be manually set if to be used)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>showBody</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Show the&#160;<strong><code>IN</code></strong> body.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>showBodyType</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Show the&#160;<strong><code>IN</code></strong> body Java type.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>showCaughtException</code>
 </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If the exchange has a caught exception, show the exception message (no stack trace).</p><p>A caught exception is stored as a property on the exchange (using the key <strong><code>Exchange.EXCEPTION_CAUGHT</code></strong>) and for instance a <strong><code>doCatch</code></strong> can catch exceptions.</p><p>See <a shape="rect" href="try-catch-finally.html">Try Catch Finally</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>showException</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If the exchange has an exception, show the exception message (no stack trace).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>showExchangeId</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>
 false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Show the unique exchange ID.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>showExchangePattern</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Shows the Message Exchange Pattern (or MEP for short).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>showFiles</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong> Whether Camel should show file bodies or not, e.g., such as <strong><code>java.io.File</code></strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>showFuture</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Wheth
 er Camel should show <strong><code>java.util.concurrent.Future</code></strong> bodies or not. If enabled Camel could potentially wait until the <strong><code>Future</code></strong> task is done. Will not wait, by default.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>showHeaders</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Show the&#160;<strong><code>IN</code></strong> message headers.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>showOut</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If the exchange has an&#160;<strong><code>OUT</code></strong> message, show the&#160;<strong><code>OUT</code></strong> message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>showProperties</code></p></td><td colspan="1" 
 rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Show the exchange properties.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>showStackTrace</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Show the stack trace, if an exchange has an exception. Only effective if one of <strong><code>showAll</code>, <code>showException</code></strong> or <strong><code>showCaughtException</code></strong> are enabled.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>showStreams</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.8:</strong> Whether Camel should show stream bodies or not, e.g., such as <strong><code>java.io.InputStream</code></strong>.</p>
+     <div class="confluence-information-macro confluence-information-macro-tip">
+      <span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span>
+      <div class="confluence-information-macro-body">
+       <p>If you enable this option then you may not be able later to access the message body as the stream have already been read by this logger.</p>
+       <p>To remedy this you will have to use <a shape="rect" href="stream-caching.html">Stream caching</a>.</p>
+      </div>
+     </div></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>skipBodyLineSeparator</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12.2:</strong> Whether to skip line separators when logging the message body. This will log the message body on a single line.</p><p>Set to <strong><code>false</code></strong> to preserve any line separators present in the body, therefore logging the body <em>as is</em>.</p></td></tr></tbody></table>
+</div></div><div class="confluence-information-macro confluence-information-macro-tip"><p class="title">Logging stream bodies</p><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>For older versions of Camel that do not support the&#160;<strong><code>showFiles</code></strong> or&#160;<strong><code>showStreams</code></strong> properties above, you can set the following property instead on the <a shape="rect" href="camelcontext.html">CamelContext</a> to log both stream and file bodies:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[camelContext.getProperties().put(Exchange.LOG_DEBUG_BODY_STREAMS, true);
 ]]></script>
-</div></div></div></div><h3 id="Log-Regularloggersample">Regular logger sample</h3><p>In the route below we log the incoming orders at <code>DEBUG</code> level before the order is processed:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from(&quot;activemq:orders&quot;).to(&quot;log:com.mycompany.order?level=DEBUG&quot;).to(&quot;bean:processOrder&quot;);
+</div></div></div></div><h3 id="Log-RegularLoggerExample">Regular Logger Example</h3><p>In the route below we log the incoming orders at <strong><code>DEBUG</code></strong> level before the order is processed:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from(&quot;activemq:orders&quot;)
+  .to(&quot;log:com.mycompany.order?level=DEBUG&quot;)
+  .to(&quot;bean:processOrder&quot;);
 ]]></script>
-</div></div><p>Or using Spring XML to define the route:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>Or using Spring XML:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[  &lt;route&gt;
     &lt;from uri=&quot;activemq:orders&quot;/&gt;
     &lt;to uri=&quot;log:com.mycompany.order?level=DEBUG&quot;/&gt;
     &lt;to uri=&quot;bean:processOrder&quot;/&gt;
   &lt;/route&gt; 
 ]]></script>
-</div></div><h3 id="Log-Regularloggerwithformattersample">Regular logger with formatter sample</h3><p>In the route below we log the incoming orders at <code>INFO</code> level before the order is processed.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from(&quot;activemq:orders&quot;).
-    to(&quot;log:com.mycompany.order?showAll=true&amp;multiline=true&quot;).to(&quot;bean:processOrder&quot;);
-]]></script>
-</div></div><h3 id="Log-ThroughputloggerwithgroupSizesample">Throughput logger with groupSize sample</h3><p>In the route below we log the throughput of the incoming orders at <code>DEBUG</code> level grouped by 10 messages.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from(&quot;activemq:orders&quot;).
-    to(&quot;log:com.mycompany.order?level=DEBUG&amp;groupSize=10&quot;).to(&quot;bean:processOrder&quot;);
-]]></script>
-</div></div><h3 id="Log-ThroughputloggerwithgroupIntervalsample">Throughput logger with groupInterval sample</h3><p>This route will result in message stats logged every 10s, with an initial 60s delay and stats should be displayed even if there isn't any message traffic.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from(&quot;activemq:orders&quot;).
-to(&quot;log:com.mycompany.order?level=DEBUG&amp;groupInterval=10000&amp;groupDelay=60000&amp;groupActiveOnly=false&quot;).to(&quot;bean:processOrder&quot;);
+</div></div><h3 id="Log-RegularLoggerwithFormatter">Regular Logger with Formatter</h3><p>In the route below we log the incoming orders at <strong><code>INFO</code></strong> level before the order is processed.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from(&quot;activemq:orders&quot;)
+  .to(&quot;log:com.mycompany.order?showAll=true&amp;multiline=true&quot;)
+  .to(&quot;bean:processOrder&quot;);
+]]></script>
+</div></div><h3 id="Log-ThroughputLoggerWithgroupSize">Throughput Logger With&#160;<strong><code>groupSize</code></strong></h3><p>In the route below we log the throughput of the incoming orders at <strong><code>DEBUG</code></strong> level grouped by 10 messages.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from(&quot;activemq:orders&quot;)
+  .to(&quot;log:com.mycompany.order?level=DEBUG&amp;groupSize=10&quot;)
+  .to(&quot;bean:processOrder&quot;);
+]]></script>
+</div></div><h3 id="Log-ThroughputLoggerWithgroupInterval">Throughput Logger With&#160;<code>groupInterval</code></h3><p>This route will result in message stats logged every <strong><code>10s</code></strong>, with an initial&#160;<strong><code>60s</code></strong> delay and stats should be displayed even if there isn't any message traffic.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from(&quot;activemq:orders&quot;)
+  .to(&quot;log:com.mycompany.order?level=DEBUG&amp;groupInterval=10000&amp;groupDelay=60000&amp;groupActiveOnly=false&quot;)
+  .to(&quot;bean:processOrder&quot;);
 ]]></script>
 </div></div><p>The following will be logged:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&quot;Received: 1000 new messages, with total 2000 so far. Last group took: 10000 millis which is: 100 messages per second. average: 100&quot;
 ]]></script>
-</div></div><h3 id="Log-Fullcustomizationoftheloggingoutput">Full customization of the logging output</h3><p><strong>Available as of Camel 2.11</strong></p><p>With the options outlined in the <a shape="rect" href="#Log-Formatting">#Formatting</a> section, you can control much of the output of the logger. However, log lines will always follow this structure:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="Log-FullCustomizationoftheLoggedOutput">Full Customization of the Logged Output</h3><p><strong>Available as of Camel 2.11</strong></p><p>With the options outlined in the <a shape="rect" href="#Log-Formatting">#Formatting</a> section, you can control much of the output of the logger. However, log lines will always follow this structure:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[Exchange[Id:ID-machine-local-50656-1234567901234-1-2, ExchangePattern:InOut, 
 Properties:{CamelToEndpoint=log://org.apache.camel.component.log.TEST?showAll=true, 
 CamelCreatedTimestamp=Thu Mar 28 00:00:00 WET 2013}, 
 Headers:{breadcrumbId=ID-machine-local-50656-1234567901234-1-1}, BodyType:String, Body:Hello World, Out: null]
 ]]></script>
-</div></div><p>This format is unsuitable in some cases, perhaps because you need to...</p><ul><li>... filter the headers and properties that are printed, to strike a balance between insight and verbosity.</li><li>... adjust the log message to whatever you deem most readable.</li><li>... tailor log messages for digestion by log mining systems, e.g. Splunk.</li><li>... print specific body types differently.</li><li>... etc.</li></ul><p>Whenever you require absolute customization, you can create a class that implements the <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/ExchangeFormatter.html"><code>ExchangeFormatter</code></a> interface. Within the <code>format(Exchange)</code> method you have access to the full Exchange, so you can select and extract the precise information you need, format it in a custom manner and return it. The return value will become the final log message.</p><p>You can have the Log compon
 ent pick up your custom <code>ExchangeFormatter</code> in either of two ways:</p><p><strong>Explicitly instantiating the LogComponent in your Registry:</strong></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;bean name=&quot;log&quot; class=&quot;org.apache.camel.component.log.LogComponent&quot;&gt;
-   &lt;property name=&quot;exchangeFormatter&quot; ref=&quot;myCustomFormatter&quot; /&gt;
+</div></div><p>This format is unsuitable in some cases, perhaps because you need to:</p><ul><li>Filter the headers and properties that are printed, to strike a balance between insight and verbosity.</li><li>Adjust the log message to whatever you deem most readable.</li><li>Tailor log messages for digestion by log mining systems, e.g. Splunk.</li><li>Print specific body types differently.</li><li>Etc.</li></ul><p>Whenever you require absolute customization, you can create a class that implements the <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/ExchangeFormatter.html"><code>ExchangeFormatter</code></a> interface. Within the <strong><code>format(Exchange)</code></strong> method you have access to the full Exchange, so you can select and extract the precise information you need, format it in a custom manner and return it. The return value will become the final log message.</p><p>You can have the Log component p
 ick up your custom <strong><code>ExchangeFormatter</code></strong> in one of two ways:</p><p><strong>Explicitly instantiating the <code>LogComponent</code> in your Registry</strong></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;bean name=&quot;log&quot; class=&quot;org.apache.camel.component.log.LogComponent&quot;&gt;
+   &lt;property name=&quot;exchangeFormatter&quot; ref=&quot;myCustomFormatter&quot;/&gt;
 &lt;/bean&gt;
 ]]></script>
-</div></div><p><strong>Convention over configuration:</strong></p><p>Simply by registering a bean with the name <code>logFormatter</code>; the Log Component is intelligent enough to pick it up automatically.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;bean name=&quot;logFormatter&quot; class=&quot;com.xyz.MyCustomExchangeFormatter&quot; /&gt;
+</div></div><p><strong>Convention Over Configuration</strong></p><p>Simply by registering a bean with the name <strong><code>logFormatter</code></strong>; the Log Component is intelligent enough to pick it up automatically.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;bean name=&quot;logFormatter&quot; class=&quot;com.xyz.MyCustomExchangeFormatter&quot;/&gt;
 ]]></script>
-</div></div><p>NOTE: the <code>ExchangeFormatter</code> gets applied to <strong>all Log endpoints within that Camel Context</strong>. If you need different ExchangeFormatters for different endpoints, just instantiate the LogComponent as many times as needed, and use the relevant bean name as the endpoint prefix.</p><p>From <strong>Camel 2.11.2/2.12</strong> onwards when using a custom log formatter, you can specify parameters in the log uri, which gets configured on the custom log formatter. Though when you do that you should define the "logFormatter" as prototype scoped so its not shared if you have different parameters, eg:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;bean name=&quot;logFormatter&quot; class=&quot;com.xyz.MyCustomExchangeFormatter&quot; scope=&quot;prototype&quot;/&gt;
+</div></div><div class="confluence-information-macro confluence-information-macro-tip"><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body">The <strong><code>ExchangeFormatter</code></strong> gets applied to <strong>all Log endpoints within that Camel Context</strong>. If you need a different&#160;<strong><code>ExchangeFormatter</code></strong> for each endpoint, just instantiate the&#160;<strong><code>LogComponent</code></strong> as many times as needed, and use the relevant bean name as the endpoint prefix.</div></div><p>From <strong>Camel 2.11.2/2.12</strong>: when using a custom log formatter, you can specify parameters in the log URI, which gets configured on the custom log formatter. Though when you do that you should define the&#160;<strong><code>logFormatter</code></strong> as prototype scoped so its not shared if you have different parameters.</p><p>Example:</p><div class="code pan
 el pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;bean name=&quot;logFormatter&quot; class=&quot;com.xyz.MyCustomExchangeFormatter&quot; scope=&quot;prototype&quot;/&gt;
 ]]></script>
-</div></div><p>And then we can have Camel routes using the log uri with different options:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;to uri=&quot;log:foo?param1=foo&amp;amp;param2=100&quot;/&gt;
-...
+</div></div><p>And then we can have Camel routes using the log URI with different options:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;to uri=&quot;log:foo?param1=foo&amp;amp;param2=100&quot;/&gt;
+&lt;!-- ... --&gt;
 &lt;to uri=&quot;log:bar?param1=bar&amp;amp;param2=200&quot;/&gt;
 ]]></script>
-</div></div><h4 id="Log-UsingLogcomponentinOSGi">Using Log component in OSGi</h4><p><strong>Improvement as of Camel 2.12.4/2.13.1</strong></p><p>When using&#160;Log component inside OSGi (e.g., in Karaf), the underlying logging mechanisms are provided by PAX logging. It searches for a bundle which invokes&#160;<code>org.slf4j.LoggerFactory.getLogger()</code> method and associates the bundle with the logger instance. Without specifying custom&#160;<code>org.sfl4j.Logger</code> instance, the logger created by Log component is associated with <code>camel-core</code> bundle.</p><p>In some scenarios it is required that the bundle associated with logger should be the bundle which contains route definition. To do this, either register single instance of&#160;<code>org.slf4j.Logger</code> in the Registry or reference it using&#160;<code>logger</code> URI parameter.</p><p></p><h3 id="Log-SeeAlso">See Also</h3>
+</div></div><h4 id="Log-UsingLogComponentinOSGi">Using Log Component in OSGi</h4><p><strong>Improvements from Camel 2.12.4/2.13.1</strong></p><p>When using&#160;<strong><code>Log</code></strong> component inside OSGi (e.g., in Karaf), the underlying logging mechanisms are provided by PAX logging. It searches for a bundle which invokes&#160;<strong><code>org.slf4j.LoggerFactory.getLogger()</code></strong> method and associates the bundle with the logger instance. Without specifying custom&#160;<strong><code>org.sfl4j.Logger</code></strong> instance, the logger created by Log component is associated with <strong><code>camel-core</code></strong> bundle.</p><p>In some scenarios it is required that the bundle associated with logger should be the bundle which contains route definition. To do this, either register a single instance of&#160;<strong><code>org.slf4j.Logger</code></strong> in the Registry or reference it using&#160;<strong><code>logger</code></strong> URI parameter.</p><p></p>
 <h3 id="Log-SeeAlso">See Also</h3>
 <ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a shape="rect" href="component.html">Component</a></li><li><a shape="rect" href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li></ul><ul><li><a shape="rect" href="tracer.html">Tracer</a></li><li><a shape="rect" href="how-do-i-use-log4j.html">How do I use log4j</a></li><li><a shape="rect" href="how-do-i-use-java-14-logging.html">How do I use Java 1.4 logging</a></li><li><a shape="rect" href="logeip.html">LogEIP</a> for using <code>log</code> directly in the DSL for human logs.</li></ul></div>
         </td>
         <td valign="top">