This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch CAMEL-13505
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 1e6ab09aa588cbc81efcb10669c526215bf133e7
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Mon Jul 29 07:19:17 2019 +0200

    CAMEL-13505: A new tracer
---
 .../camel/blueprint/CamelContextFactoryBean.java   |  10 +
 .../camel/cdi/xml/CamelContextFactoryBean.java     |  12 +-
 .../src/main/docs/spring-boot.adoc                 |   4 +-
 .../spring/boot/CamelConfigurationProperties.java  |  15 ++
 .../camel/spring/CamelContextFactoryBean.java      |  16 ++
 .../apache/camel/impl/engine/DefaultTracer.java    |  20 +-
 .../core/xml/AbstractCamelContextFactoryBean.java  |   5 +
 .../camel/main/DefaultConfigurationConfigurer.java |   2 +-
 .../camel/main/DefaultConfigurationProperties.java |  10 +-
 .../camel-main-configuration-metadata.json         |   6 +
 docs/user-manual/modules/ROOT/pages/tracer.adoc    | 211 ++-------------------
 .../src/main/resources/application.properties      |   6 +-
 12 files changed, 99 insertions(+), 218 deletions(-)

diff --git 
a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/CamelContextFactoryBean.java
 
b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/CamelContextFactoryBean.java
index 5c80272..1c3270c 100644
--- 
a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/CamelContextFactoryBean.java
+++ 
b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/CamelContextFactoryBean.java
@@ -92,6 +92,8 @@ public class CamelContextFactoryBean extends 
AbstractCamelContextFactoryBean<Blu
     @XmlAttribute
     private String trace;
     @XmlAttribute
+    private String tracePattern;
+    @XmlAttribute
     private String messageHistory;
     @XmlAttribute
     private String logMask;
@@ -547,6 +549,14 @@ public class CamelContextFactoryBean extends 
AbstractCamelContextFactoryBean<Blu
         this.trace = trace;
     }
 
+    public String getTracePattern() {
+        return tracePattern;
+    }
+
+    public void setTracePattern(String tracePattern) {
+        this.tracePattern = tracePattern;
+    }
+
     public String getMessageHistory() {
         return messageHistory;
     }
diff --git 
a/components/camel-cdi/src/main/java/org/apache/camel/cdi/xml/CamelContextFactoryBean.java
 
b/components/camel-cdi/src/main/java/org/apache/camel/cdi/xml/CamelContextFactoryBean.java
index 1267ce8..5381608 100644
--- 
a/components/camel-cdi/src/main/java/org/apache/camel/cdi/xml/CamelContextFactoryBean.java
+++ 
b/components/camel-cdi/src/main/java/org/apache/camel/cdi/xml/CamelContextFactoryBean.java
@@ -77,6 +77,9 @@ public class CamelContextFactoryBean extends 
AbstractCamelContextFactoryBean<Def
     private String trace;
 
     @XmlAttribute
+    private String tracePattern;
+
+    @XmlAttribute
     private String messageHistory;
 
     @XmlAttribute
@@ -525,6 +528,14 @@ public class CamelContextFactoryBean extends 
AbstractCamelContextFactoryBean<Def
         this.trace = trace;
     }
 
+    public String getTracePattern() {
+        return tracePattern;
+    }
+
+    public void setTracePattern(String tracePattern) {
+        this.tracePattern = tracePattern;
+    }
+
     public String getMessageHistory() {
         return messageHistory;
     }
@@ -638,7 +649,6 @@ public class CamelContextFactoryBean extends 
AbstractCamelContextFactoryBean<Def
         this.threadNamePattern = threadNamePattern;
     }
 
-    @Override
     public Boolean getLoadTypeConverters() {
         return loadTypeConverters;
     }
diff --git a/components/camel-spring-boot/src/main/docs/spring-boot.adoc 
b/components/camel-spring-boot/src/main/docs/spring-boot.adoc
index 727d7cb..079ed0e 100644
--- a/components/camel-spring-boot/src/main/docs/spring-boot.adoc
+++ b/components/camel-spring-boot/src/main/docs/spring-boot.adoc
@@ -89,7 +89,7 @@ When using Spring Boot make sure to use the following Maven 
dependency to have s
 ----
 
 
-The component supports 124 options, which are listed below.
+The component supports 126 options, which are listed below.
 
 
 
@@ -145,6 +145,7 @@ The component supports 124 options, which are listed below.
 | *camel.language.enabled* | Global option to enable/disable language 
auto-configuration, default is true. | true | Boolean
 | *camel.springboot.allow-use-original-message* | Sets whether to allow access 
to the original message from Camel's error handler, or from 
org.apache.camel.spi.UnitOfWork.getOriginalInMessage(). Turning this off can 
optimize performance, as defensive copy of the original message is not needed. 
Default is false. | false | Boolean
 | *camel.springboot.auto-startup* | Sets whether the object should 
automatically start when Camel starts. Important: Currently only routes can be 
disabled, as CamelContext's are always started. Note: When setting auto startup 
false on CamelContext then that takes precedence and no routes is started. You 
would need to start CamelContext explicit using the 
org.apache.camel.CamelContext.start() method, to start the context, and then 
you would need to start the routes manually using Camelcon [...]
+| *camel.springboot.backlog-tracing* | Sets whether backlog tracing is enabled 
or not. Default is false. | false | Boolean
 | *camel.springboot.consumer-template-cache-size* | Consumer template 
endpoints cache size. | 1000 | Integer
 | *camel.springboot.duration-max-idle-seconds* | To specify for how long time 
in seconds Camel can be idle before automatic terminating the JVM. You can use 
this to run Spring Boot for a short while. | 0 | Integer
 | *camel.springboot.duration-max-messages* | To specify how many messages to 
process by Camel before automatic terminating the JVM. You can use this to run 
Spring Boot for a short while. | 0 | Integer
@@ -185,6 +186,7 @@ The component supports 124 options, which are listed below.
 | *camel.springboot.stream-caching-statistics-enabled* | Sets whether stream 
caching statistics is enabled. | false | Boolean
 | *camel.springboot.thread-name-pattern* | Sets the thread name pattern used 
for creating the full thread name. The default pattern is: Camel (#camelId#) 
thread ##counter# - #name# Where #camelId# is the name of the CamelContext. and 
#counter# is a unique incrementing counter. and #name# is the regular thread 
name. You can also use #longName# which is the long thread name which can 
includes endpoint parameters etc. |  | String
 | *camel.springboot.tracing* | Sets whether tracing is enabled or not. Default 
is false. | false | Boolean
+| *camel.springboot.tracing-pattern* | Tracing pattern to match which node 
EIPs to trace. For example to match all To EIP nodes, use to*. The pattern 
matches by node and route id's Multiple patterns can be separated by comma. |  
| String
 | *camel.springboot.use-breadcrumb* | Set whether breadcrumb is enabled. The 
default value is false. | false | Boolean
 | *camel.springboot.use-data-type* | Whether to enable using data type on 
Camel messages. Data type are automatic turned on if one ore more routes has 
been explicit configured with input and output types. Otherwise data type is 
default off. | false | Boolean
 | *camel.springboot.use-mdc-logging* | To turn on MDC logging | false | Boolean
diff --git 
a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
 
b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
index 54d3296..9adbbcf 100644
--- 
a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
+++ 
b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
@@ -304,6 +304,13 @@ public class CamelConfigurationProperties extends 
DefaultConfigurationProperties
     private boolean streamCachingStatisticsEnabled;
 
     /**
+     * Sets whether backlog tracing is enabled or not.
+     *
+     * Default is false.
+     */
+    private boolean backlogTracing;
+
+    /**
      * Sets whether tracing is enabled or not.
      *
      * Default is false.
@@ -311,6 +318,14 @@ public class CamelConfigurationProperties extends 
DefaultConfigurationProperties
     private boolean tracing;
 
     /**
+     * Tracing pattern to match which node EIPs to trace.
+     * For example to match all To EIP nodes, use to*.
+     * The pattern matches by node and route id's
+     * Multiple patterns can be separated by comma.
+     */
+    private String tracingPattern;
+
+    /**
      * Sets whether message history is enabled or not.
      *
      * Default is true.
diff --git 
a/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
 
b/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
index 57e852c..ef66f72 100644
--- 
a/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
+++ 
b/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
@@ -104,6 +104,8 @@ public class CamelContextFactoryBean extends 
AbstractCamelContextFactoryBean<Spr
     private String dependsOn;
     @XmlAttribute
     private String trace;
+    @XmlAttribute
+    private String tracePattern;
     @XmlAttribute @Metadata(defaultValue = "true")
     private String messageHistory;
     @XmlAttribute @Metadata(defaultValue = "false")
@@ -659,6 +661,20 @@ public class CamelContextFactoryBean extends 
AbstractCamelContextFactoryBean<Spr
         this.trace = trace;
     }
 
+    public String getTracePattern() {
+        return tracePattern;
+    }
+
+    /**
+     * Tracing pattern to match which node EIPs to trace.
+     * For example to match all To EIP nodes, use to*.
+     * The pattern matches by node and route id's
+     * Multiple patterns can be separated by comma.
+     */
+    public void setTracePattern(String tracePattern) {
+        this.tracePattern = tracePattern;
+    }
+
     public String getMessageHistory() {
         return messageHistory;
     }
diff --git 
a/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultTracer.java 
b/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultTracer.java
index 2ce336f..f939f20 100644
--- 
a/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultTracer.java
+++ 
b/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultTracer.java
@@ -42,9 +42,6 @@ import org.slf4j.LoggerFactory;
  */
 public class DefaultTracer extends ServiceSupport implements 
CamelContextAware, Tracer {
 
-    // TODO: Expose these options in Tracer API / Main Configuration
-    // TODO: Add options for spring-boot configuration too
-
     private static final String TRACING_OUTPUT = "%-4.4s [%-12.12s] 
[%-33.33s]";
 
     // use a fixed logger name so its easy to spot
@@ -59,6 +56,13 @@ public class DefaultTracer extends ServiceSupport implements 
CamelContextAware,
     private boolean traceBeforeAndAfterRoute = true;
 
     public DefaultTracer() {
+        DefaultExchangeFormatter formatter = new DefaultExchangeFormatter();
+        formatter.setShowExchangeId(true);
+        formatter.setShowExchangePattern(false);
+        formatter.setMultiline(false);
+        formatter.setShowHeaders(false);
+        formatter.setStyle(DefaultExchangeFormatter.OutputStyle.Default);
+        setExchangeFormatter(formatter);
     }
 
     @Override
@@ -249,15 +253,7 @@ public class DefaultTracer extends ServiceSupport 
implements CamelContextAware,
 
     @Override
     protected void doStart() throws Exception {
-        if (exchangeFormatter == null) {
-            DefaultExchangeFormatter formatter = new 
DefaultExchangeFormatter();
-            formatter.setShowExchangeId(true);
-            formatter.setShowExchangePattern(false);
-            formatter.setMultiline(false);
-            formatter.setShowHeaders(false);
-            formatter.setStyle(DefaultExchangeFormatter.OutputStyle.Default);
-            setExchangeFormatter(formatter);
-        }
+        // noop
     }
 
     @Override
diff --git 
a/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
 
b/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
index 5e567e7..f3a1799 100644
--- 
a/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
+++ 
b/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
@@ -732,6 +732,8 @@ public abstract class AbstractCamelContextFactoryBean<T 
extends ModelCamelContex
 
     public abstract String getTrace();
 
+    public abstract String getTracePattern();
+
     public abstract String getMessageHistory();
 
     public abstract String getLogMask();
@@ -824,6 +826,9 @@ public abstract class AbstractCamelContextFactoryBean<T 
extends ModelCamelContex
         if (getTrace() != null) {
             context.setTracing(CamelContextHelper.parseBoolean(context, 
getTrace()));
         }
+        if (getTracePattern() != null) {
+            context.setTracingPattern(CamelContextHelper.parseText(context, 
getTracePattern()));
+        }
         if (getMessageHistory() != null) {
             context.setMessageHistory(CamelContextHelper.parseBoolean(context, 
getMessageHistory()));
         }
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java
index 0313389..b8fdc6a 100644
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java
+++ 
b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java
@@ -151,7 +151,7 @@ public final class DefaultConfigurationConfigurer {
 
         camelContext.setBacklogTracing(config.isBacklogTracing());
         camelContext.setTracing(config.isTracing());
-        camelContext.setTracingPattern(config.getTracingPatterns());
+        camelContext.setTracingPattern(config.getTracingPattern());
 
         if (config.getThreadNamePattern() != null) {
             
camelContext.getExecutorServiceManager().setThreadNamePattern(config.getThreadNamePattern());
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
index d634e2a..e4ce762 100644
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
+++ 
b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
@@ -51,7 +51,7 @@ public abstract class DefaultConfigurationProperties<T> {
     private boolean streamCachingStatisticsEnabled;
     private boolean backlogTracing;
     private boolean tracing;
-    private String tracingPatterns;
+    private String tracingPattern;
     private boolean messageHistory = true;
     private boolean logMask;
     private boolean logExhaustedMessageBody;
@@ -400,8 +400,8 @@ public abstract class DefaultConfigurationProperties<T> {
         this.tracing = tracing;
     }
 
-    public String getTracingPatterns() {
-        return tracingPatterns;
+    public String getTracingPattern() {
+        return tracingPattern;
     }
 
     /**
@@ -410,8 +410,8 @@ public abstract class DefaultConfigurationProperties<T> {
      * The pattern matches by node and route id's
      * Multiple patterns can be separated by comma.
      */
-    public void setTracingPatterns(String tracingPatterns) {
-        this.tracingPatterns = tracingPatterns;
+    public void setTracingPattern(String tracingPattern) {
+        this.tracingPattern = tracingPattern;
     }
 
     public boolean isBacklogTracing() {
diff --git 
a/core/camel-main/src/main/resources/META-INF/camel-main-configuration-metadata.json
 
b/core/camel-main/src/main/resources/META-INF/camel-main-configuration-metadata.json
index c287880..2f7a884 100644
--- 
a/core/camel-main/src/main/resources/META-INF/camel-main-configuration-metadata.json
+++ 
b/core/camel-main/src/main/resources/META-INF/camel-main-configuration-metadata.json
@@ -326,6 +326,12 @@
                        "description":"Sets whether tracing is enabled or not. 
Default is false."
                },
                {
+                       "name":"camel.main.tracing-pattern",
+                       "type":"java.lang.String",
+                       
"sourceType":"org.apache.camel.main.DefaultConfigurationProperties",
+                       "description":"Tracing pattern to match which node EIPs 
to trace. For example to match all To EIP nodes, use to. The pattern matches by 
node and route id's Multiple patterns can be separated by comma."
+               },
+               {
                        "name":"camel.main.use-breadcrumb",
                        "type":"boolean",
                        
"sourceType":"org.apache.camel.main.DefaultConfigurationProperties",
diff --git a/docs/user-manual/modules/ROOT/pages/tracer.adoc 
b/docs/user-manual/modules/ROOT/pages/tracer.adoc
index 0cd9781..c737ddb 100644
--- a/docs/user-manual/modules/ROOT/pages/tracer.adoc
+++ b/docs/user-manual/modules/ROOT/pages/tracer.adoc
@@ -1,211 +1,26 @@
-= Tracer Interceptor
+= Tracer
 
-Implementing custom tracing via TracingInterceptor has been deprecated.
-However turning tracing on via `setTracing(true)` is okay.
-
-Camel's tracer interceptor can be used for logging, by default at the
-*`INFO`* level, a route's execution. The tracer is an instance of
-*`org.apache.camel.spi.InterceptStrategy`*. It can be applied to either
-a *`DefaultCamelContext`* or a *`SpringCamelContext`* to ensure that
-there is a *`TracerInterceptor`* created for every node in the route.
-The tracer's logging can be enabled/disabled dynamically by calling its
-*`setEnabled`* method.
-
-From *Camel 2.12*: the xref:camelcontext.adoc[CamelContext] must be
-explicitly configured for tracing:
-
-* XML:  *`<camelContext trace="true" ...>`*
-* Java: *`camelContext.setTracing(true)`*.
+Camel's tracer is used for logging message details during routing, where
+you can see the route path of each message as they happens. Details of the 
message is also logged such as the message body.
 
 == Formatting
 
 The tracer formats the execution of exchanges to log lines. They are
 logged at *`INFO`* level in the log category:
-*`org.apache.camel.processor.interceptor.TraceInterceptor`*. By default
-the tracer uses:
-*`org.apache.camel.processor.interceptor.DefaultTraceFormatter`* to
-format the log line.
-
-*`DefaultTraceFormatter`* has the following options:
-
-[width="100%",cols="34%,33%,33%",options="header",]
-|=======================================================================
-|Option |Default |Description
-|`breadCrumbLength` |`0` a|
-Fixed length of the bread crumb. 
-
-`0` = no fixed length.
-
-Setting a value to e.g. `80` allows the tracer logs to be aligned for
-easier reading.
-
-|`maxChars` |  a|
-Limits the number of chars logged per line.
-
-From *Camel 2.9*: the default value is *`10000`.*
-
-|`multiline` |`false` |*Camel 2.18:* If *`true`* each piece of
-information is logged on a new line.
-
-|`nodeLength` |`0` a|
-Fixed length of the node. 
-
-`0` = no fixed length.
-
-Setting a value to e.g. `40` allows the tracer logs to be aligned for
-easier reading.
-
-|`showBody` |`true` |Output the *`IN`* body.
-
-|`showBodyType` |`true` |Output the *`IN`* body Java type.
-
-|`showBreadCrumb` |`true` a|
-Outputs the unique UnitOfWork for the exchange.
-
-Can be used for correlation to identify a particular Exchange.
-
-|`showException` |`true` |Output the exception if the processing of an
-Exchange has failed.
-
-|`showExchangeId` |`false` a|
-Enable/disable the output of an Exchange's unique *`id`*.
-
-Currently the breadcrumb is sufficient.
+*`org.apache.camel.Tracing`*. 
 
-|`showExchangePattern` |`true` |Output the Message Exchange Pattern
-(MEP).
-
-|`showHeaders` |`true` |Output the *`IN`* message headers.
-
-|`showNode` |`true` a|
-Previous and destination node.
-
-Displayed as: *`from -> to`*.
-
-|`showOutBody` |`false` |Output the *`OUT`* (if any) body.
-
-|`showOutBodyType` |`false` |Output the *`OUT`* (if any) body Java type.
-
-|`showOutHeaders` |`false` |Output the *`OUT`* (if any) message headers.
-
-|`showProperties` |`false` |Output the Exchange's properties.
-
-|`showRouteId` |`true` |*Camel 2.8:* output the *`id`* of the route.
-
-|`showShortExchangeId` |`false` |To output the Exchange's unique *`id`*
-in short form, without the hostname.
-|=======================================================================
-
-Logging stream bodies
-
-From *Camel 2.8*: the Camel xref:tracer.adoc[Tracer] will by default
-_not_ log stream or files bodies. To force Camel to log these set the
-following property on the xref:camelcontext.adoc[CamelContext]
-properties:
-
-[source,java]
-----
-camelContext.getProperties().put(Exchange.LOG_DEBUG_BODY_STREAMS, true);
-----
-
-Example:
-
-----
-ID-claus-acer/4412-1222625653890/2-0 -> to(mock:a) , Pattern:InOnly ,
-Headers:\{to=James} , BodyType:String , Body:Hello London
-----
-
-where:
-
-* *`ID-claus-acer/3690-1214458315718/2-0`* is the breadcrumb with the
-unique correlation id.
-* *`node3`* is the id of the node in the route path. Always displayed.
-* *`To[mock:a]`* is the destination node.
-* *`InOnly`* is the exchange pattern. Is always shown.
-* Then the rest is properties, headers and the body.
-
-== Showing `from` and `to`
-
-The trace log will output both the from and to so you can see where the
-Exchange came from, such as:
-
-----
->>> direct:start --> process(MyProcessor) >>> process(MyProcessor) -->
-to(mock:a) >>> to(mock:a) --> to(mock:b)
-----
+The message information from the Exchange is formatted using 
`ExchangeFormatter` and the default implementation has many options you can 
configure. See the source code/javadoc of the 
`org.apache.camel.support.processor.DefaultExchangeFormatter` class.
 
 == Enabling
 
-To enable tracer from the main run:
-
-[source,shell]
-----
-java org.apache.camel.spring.Main -t
-----
-
-or
-
-[source,shell]
-----
-java org.apache.camel.spring.Main -trace
-----
-
-and the tracer will be activated.
-
-== Enabling in Java
+In Java you set tracing on `CamelContext`:
 
 [source,java]
 ----
 context.setTracing(true);
 ----
 
-You can configure tracing at a higher granularity as you can configure
-it on camel context and then override and set it per route as well. For
-instance you could just enable the tracer for a particular route.
-
-----
-INFO TraceInterceptor - ID-davsclaus-local-54403-1246038742624-0-0 >>> 
from(direct:start) --> MyProcessor , Pattern:InOnly, Headers:\{to=James}, 
BodyType:String, Body:Hello London
-INFO TraceInterceptor - ID-davsclaus-local-54403-1246038742624-0-0 >>> 
MyProcessor --> mock:a , Pattern:InOnly, Headers:\{to=James}, BodyType:String, 
Body:Hello London
-INFO TraceInterceptor - ID-davsclaus-local-54403-1246038742624-0-0 >>> mock:a 
--> mock:b , Pattern:InOnly, Headers:\{to=James}, BodyType:String, Body:Hello 
London ...
-INFO TraceInterceptor - ID-davsclaus-local-54403-1246038742624-0-1 >>> 
from(direct:start) --> MyProcessor , Pattern:InOnly, Headers:\{from=Claus}, 
BodyType:String, Body:This is Copenhagen calling
-INFO TraceInterceptor - ID-davsclaus-local-54403-1246038742624-0-1 >>>  
MyProcessor --> mock:a , Pattern:InOnly, Headers:\{from=Claus}, 
BodyType:String, Body:This is Copenhagen calling INFO TraceInterceptor - 
ID-davsclaus-local-54403-1246038742624-0-1 >>> mock:a --> mock:b , 
Pattern:InOnly, Headers:\{from=Claus}, BodyType:String, Body:This is Copenhagen 
calling
-----
-
-== Configuring in Java
-
-Tracer options can be configured in Java as follows:
-
-[source,java]
-----
-public void configure() throws Exception {
-    // add tracer as an interceptor so it will log the exchange executions at 
runtime
-    // this can aid us to understand/see how the exchanges is routed etc.
-    Tracer tracer = new Tracer();
-    formatter.getDefaultTraceFormatter().setShowBreadCrumb(false);
-    formatter.getDefaultTraceFormatter().setShowNode(false); ...
-    getContext().addInterceptStrategy(tracer);
-}
-----
-
-== Using Predicates to Filter Exchanges
-
-In the code below we want the tracer only to trace if the body contains
-the text *`London`*. As this is just an example can of course set any
-xref:predicate.adoc[Predicate] that matches your criteria:
-
-[source,java]
-----
-Tracer tracer = new Tracer(); // set the level to FATAL so we can easily spot 
it
-tracer.setLogLevel(LoggingLevel.FATAL); // and only trace if the body contains 
London as text
-tracer.setTraceFilter(body().contains(constant("London")));
-----
-
-== Enabling in Spring XML
-
-There is now a *`trace`* attribute you can specify on
-the *`<camelContext/>`*.
-
-Example:
+And in XML DSL:
 
 [source,xml]
 ----
@@ -214,11 +29,13 @@ Example:
 </camelContext>
 ----
 
-You can see this in action with the
-https://github.com/apache/camel/blob/master/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringTraceTest.java[SpringTraceTest]
-and its
-https://github.com/apache/camel/blob/master/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringTraceTest-context.xml[spring.xml
-file]
+And in Spring Boot
+
+[source,text]
+----
+camel.springboot.tracing = true
+----
+
 
 == See Also
 
diff --git 
a/examples/camel-example-main/src/main/resources/application.properties 
b/examples/camel-example-main/src/main/resources/application.properties
index 3f19af4..9d61440 100644
--- a/examples/camel-example-main/src/main/resources/application.properties
+++ b/examples/camel-example-main/src/main/resources/application.properties
@@ -21,7 +21,11 @@ camel.main.name = MyCoolCamel
 camel.main.jmx-enabled = false
 
 # enable tracing
-### camel.main.tracing = true
+# camel.main.tracing = true
+# configure tracing what to include from the exchange
+#camel.context.tracer.exchange-formatter.show-exchange-id = false
+#camel.context.tracer.exchange-formatter.show-headers = true
+#camel.context.tracer.exchange-formatter.show-body-type = false
 
 # you can also configure camel context directly
 # camel.context.shutdown-strategy.shutdown-now-on-timeout = false

Reply via email to