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 2013/06/24 12:18:49 UTC

svn commit: r867188 [3/3] - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache file2.html how-do-i-set-the-max-chars-when-debug-logging-messages-in-camel.html

Modified: websites/production/camel/content/how-do-i-set-the-max-chars-when-debug-logging-messages-in-camel.html
==============================================================================
--- websites/production/camel/content/how-do-i-set-the-max-chars-when-debug-logging-messages-in-camel.html (original)
+++ websites/production/camel/content/how-do-i-set-the-max-chars-when-debug-logging-messages-in-camel.html Mon Jun 24 10:18:49 2013
@@ -35,6 +35,8 @@
     </style>
     <![endif]-->
 
+
+
     <title>
     Apache Camel: How do I set the max chars when debug logging messages in Camel
     </title>
@@ -52,8 +54,8 @@
     <div class="content_r">
       <div>
           <!-- Banner -->
-<div id="banner-content">
-	<div id="asf_logo">
+<div id="banner-content"><p>
+	</p><div id="asf_logo">
 	<div id="activemq_logo" style="height:108px; background:transparent url(banner.data/apache-camel-7.png) no-repeat scroll left top;">
             <a shape="rect" style="float:left; width:310px;display:block;text-indent:-5000px;text-decoration:none;line-height:140px; margin-top:20px; margin-left:18px;" href="http://camel.apache.org/">Camel</a>
             <a shape="rect" style="float:right; width:180px;display:block;text-indent:-5000px;text-decoration:none;line-height:80px; margin-top:45px; margin-right:10px;" href="http://www.apache.org">Apache</a>
@@ -78,40 +80,33 @@
 <div class="wiki-content maincontent"><h3><a shape="rect" name="HowdoIsetthemaxcharswhendebugloggingmessagesinCamel-HowdoIsetthemaxcharswhendebugloggingmessagesinCamel"></a>How do I set the max chars when debug logging messages in Camel</h3>
 <p><b>Available as of Camel 2.0</b></p>
 
-<p>When you run Camel with <tt>DEBUG</tt> level as logging, it will log the messages and its content from time to time.<br clear="none">
+<p>When you run Camel with logging, it will log the messages and its content from time to time.<br clear="none">
 As some messages can contain very big payloads Camel will by default clip the log message and only show the first 1000 chars.</p>
 
 <p>You will see this in the log as:</p>
-<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java"> 
-DEBUG ProducerCache                  - &gt;&gt;&gt;&gt; Endpoint[direct:start] Exchange[Message: 01234567890123456789... [Body clipped after 20 chars, total length is 1000]]
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>DEBUG ProducerCache                  - &gt;&gt;&gt;&gt; Endpoint<span class="error">[direct:start]</span> Exchange[Message: 01234567890123456789... <span class="error">[Body clipped after 20 chars, total length is 1000]</span>]</p></div>
 
 <p>Here we have a big message that just contains many numbers. As its based on an unit test we have set a custom limit of 20 chars, and we have a payload with 1000 chars in total. </p>
 
-<p>You can customize the limit when Camel clips the body in the DEBUG log.<br clear="none">
+<p>You can customize the limit when Camel clips the body in the log.<br clear="none">
 You can use a limit of 0 or negative to disable it so the entire body is shown.</p>
 
+<p>From <b>Camel 2.12</b> onwards, setting a negative value, such as -1, means the message body is not logged. For earlier Camel versions, you would need to set the value to 1, and have the first char logged.</p>
+
 <h4><a shape="rect" name="HowdoIsetthemaxcharswhendebugloggingmessagesinCamel-CustomizingfromJavaDSL"></a>Customizing from Java DSL</h4>
 <p>You add to the Camel properties the limit. For example to limit at 500 chars:</p>
-<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-        context.getProperties().put(Exchange.LOG_DEBUG_BODY_MAX_CHARS, <span class="code-quote">"500"</span>);
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>        context.getProperties().put(Exchange.LOG_DEBUG_BODY_MAX_CHARS, "500");</p></div>
 
 <h4><a shape="rect" name="HowdoIsetthemaxcharswhendebugloggingmessagesinCamel-CustomizingfromSpringDSL"></a>Customizing from Spring DSL</h4>
 <p>You add to the Camel properties the limit. For example to limit at 500 chars:</p>
-<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml">
-   <span class="code-tag">&lt;camelContext&gt;</span>
-       <span class="code-tag">&lt;properties&gt;</span>
-           <span class="code-tag">&lt;property key=<span class="code-quote">"CamelLogDebugBodyMaxChars"</span> value=<span class="code-quote">"500"</span>/&gt;</span>
-      <span class="code-tag">&lt;/properties&gt;</span>
-   <span class="code-tag">&lt;/camelContext&gt;</span>
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>   &lt;camelContext&gt;<br clear="none">
+       &lt;properties&gt;<br clear="none">
+           &lt;property key="CamelLogDebugBodyMaxChars" value="500"/&gt;<br clear="none">
+      &lt;/properties&gt;<br clear="none">
+   &lt;/camelContext&gt;</p></div>
 </div>
         </td>
         <td valign="top">
@@ -130,8 +125,8 @@ You can use a limit of 0 or negative to 
 
 <h3><a shape="rect" name="Navigation-Search"></a>Search</h3>
 
-
-<form enctype="application/x-www-form-urlencoded" method="get" id="cse-search-box" action="http://www.google.com/cse">
+<p>
+</p><form enctype="application/x-www-form-urlencoded" method="get" id="cse-search-box" action="http://www.google.com/cse">
   <div>
     <input type="hidden" name="cx" value="007878419884033443453:m5nhvy4hmyq">
     <input type="hidden" name="ie" value="UTF-8">