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

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

commit 5741277d9c41a17b36e151af69ef830d8e9e4014
Author: Claus Ibsen <[email protected]>
AuthorDate: Sun Jan 2 17:25:40 2022 +0100

    CAMEL-17338: Tracer - Use source loc:line in logger name. WIP
---
 .../src/main/java/org/apache/camel/model/ProcessorDefinition.java  | 6 +++---
 .../src/main/java/org/apache/camel/model/RouteDefinition.java      | 7 ++++---
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git 
a/core/camel-core-model/src/main/java/org/apache/camel/model/ProcessorDefinition.java
 
b/core/camel-core-model/src/main/java/org/apache/camel/model/ProcessorDefinition.java
index 1dd3fa8..b23e1b9 100644
--- 
a/core/camel-core-model/src/main/java/org/apache/camel/model/ProcessorDefinition.java
+++ 
b/core/camel-core-model/src/main/java/org/apache/camel/model/ProcessorDefinition.java
@@ -168,9 +168,9 @@ public abstract class ProcessorDefinition<Type extends 
ProcessorDefinition<Type>
         RouteDefinition route = ProcessorDefinitionHelper.getRoute(this);
         if (route != null) {
             CamelContext context = route.getCamelContext();
-            if (context != null && context.isDebugging()) {
-                // we want to capture source location:line for every output 
when debugging is enabled
-                // this is an expensive operation and therefore only used if 
debugging is enabled
+            if (context != null && (context.isDebugging() || 
context.isTracing())) {
+                // we want to capture source location:line for every output
+                // (this is an expensive operation, so only do this if 
debugging or tracing is enabled)
                 ProcessorDefinitionHelper.prepareSourceLocation(output);
                 if (log.isDebugEnabled()) {
                     log.debug("{} located in {}:{}", output.getShortName(), 
output.getLocation(),
diff --git 
a/core/camel-core-model/src/main/java/org/apache/camel/model/RouteDefinition.java
 
b/core/camel-core-model/src/main/java/org/apache/camel/model/RouteDefinition.java
index b19c0af..1fabdf4 100644
--- 
a/core/camel-core-model/src/main/java/org/apache/camel/model/RouteDefinition.java
+++ 
b/core/camel-core-model/src/main/java/org/apache/camel/model/RouteDefinition.java
@@ -733,9 +733,10 @@ public class RouteDefinition extends 
OutputDefinition<RouteDefinition> implement
         // does not have a <from> as it is implied to be the rest endpoint
         this.input = input;
 
-        if (getCamelContext() != null && getCamelContext().isDebugging()) {
-            // we want to capture source location:line for every output when 
debugging is enabled
-            // this is an expensive operation and therefore only used if 
debugging is enabled
+        if (getCamelContext() != null
+                && (getCamelContext().isDebugging() || 
getCamelContext().isTracing())) {
+            // we want to capture source location:line for every output
+            // (this is an expensive operation, so only do this if debugging 
or tracing is enabled)
             ProcessorDefinitionHelper.prepareSourceLocation(input);
             if (log.isDebugEnabled()) {
                 log.debug("{} located in {}:{}", input.getShortName(), 
input.getLocation(),

Reply via email to