camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zregv...@apache.org
Subject camel git commit: CAMEL-10885 A follow-up - masking formatter should be applied in all process()
Date Fri, 31 Mar 2017 19:56:27 GMT
Repository: camel
Updated Branches:
  refs/heads/master a120a7943 -> 0ae9b626c


CAMEL-10885 A follow-up - masking formatter should be applied in all process()


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0ae9b626
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0ae9b626
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0ae9b626

Branch: refs/heads/master
Commit: 0ae9b626c4d5f125d69892e32f7eb88c4a14a680
Parents: a120a79
Author: Tomohisa Igarashi <tm.igarashi@gmail.com>
Authored: Fri Mar 31 09:39:25 2017 +0900
Committer: Zoran Regvart <zregvart@apache.org>
Committed: Fri Mar 31 21:56:01 2017 +0200

----------------------------------------------------------------------
 .../org/apache/camel/processor/CamelLogProcessor.java   | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/0ae9b626/camel-core/src/main/java/org/apache/camel/processor/CamelLogProcessor.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/CamelLogProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/CamelLogProcessor.java
index b4a1939..e5a3e5c 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/CamelLogProcessor.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/CamelLogProcessor.java
@@ -88,13 +88,21 @@ public class CamelLogProcessor implements AsyncProcessor, IdAware {
 
     public void process(Exchange exchange, Throwable exception) {
         if (log.shouldLog()) {
-            log.log(formatter.format(exchange), exception);
+            String output = formatter.format(exchange);
+            if (maskingFormatter != null) {
+                output = maskingFormatter.format(output);
+            }
+            log.log(output, exception);
         }
     }
 
     public void process(Exchange exchange, String message) {
         if (log.shouldLog()) {
-            log.log(formatter.format(exchange) + message);
+            String output = formatter.format(exchange) + message;
+            if (maskingFormatter != null) {
+                output = maskingFormatter.format(output);
+            }
+            log.log(output);
         }
     }
 


Mime
View raw message