camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [3/3] camel git commit: CAMEL-9539: toString of Exchange/Message should only output id
Date Wed, 27 Jan 2016 13:31:08 GMT
CAMEL-9539: toString of Exchange/Message should only output id


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

Branch: refs/heads/master
Commit: 4da48dff0cb0fbb644c6e3d045cefeff420b130a
Parents: 1d20e33
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Wed Jan 27 14:14:36 2016 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Jan 27 14:30:56 2016 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/impl/DefaultExchange.java  | 3 ++-
 .../src/main/java/org/apache/camel/impl/DefaultMessage.java   | 5 -----
 .../src/main/java/org/apache/camel/impl/MessageSupport.java   | 7 +++++++
 3 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4da48dff/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
index 58aa50b..00b8f00 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
@@ -80,7 +80,8 @@ public final class DefaultExchange implements Exchange {
 
     @Override
     public String toString() {
-        return String.format("Exchange[%s][%s]", exchangeId == null ? "" : exchangeId, out
== null ? in : out);
+        // do not output details from message body/headers etc as it may contain sensitive
data
+        return String.format("Exchange[%s]", exchangeId == null ? "" : exchangeId);
     }
 
     public Exchange copy() {

http://git-wip-us.apache.org/repos/asf/camel/blob/4da48dff/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
index 24ba1ec..2ed3276 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
@@ -42,11 +42,6 @@ public class DefaultMessage extends MessageSupport {
     private Map<String, Object> headers;
     private Map<String, DataHandler> attachments;
 
-    @Override
-    public String toString() {
-        return MessageHelper.extractBodyForLogging(this);
-    }
-
     public boolean isFault() {
         return fault;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/4da48dff/camel-core/src/main/java/org/apache/camel/impl/MessageSupport.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/MessageSupport.java b/camel-core/src/main/java/org/apache/camel/impl/MessageSupport.java
index 369196c..747859d 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/MessageSupport.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/MessageSupport.java
@@ -223,4 +223,11 @@ public abstract class MessageSupport implements Message {
         }
         return uuid;
     }
+
+    @Override
+    public String toString() {
+        // do not output details from message body/headers etc as it may contain sensitive
data
+        return String.format("Message[%s]", messageId == null ? "" : messageId);
+    }
+
 }


Mime
View raw message