camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: camel-connector - Lets sanitize the log
Date Thu, 06 Apr 2017 15:54:43 GMT
Repository: camel
Updated Branches:
  refs/heads/master be34683e3 -> 04f25a609


camel-connector - Lets sanitize the log


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

Branch: refs/heads/master
Commit: 04f25a6093482c4bd16a5b5662639819646aff68
Parents: be34683
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Thu Apr 6 17:49:50 2017 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Thu Apr 6 17:49:50 2017 +0200

----------------------------------------------------------------------
 .../camel/component/connector/DefaultConnectorComponent.java  | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/04f25a60/connectors/camel-connector/src/main/java/org/apache/camel/component/connector/DefaultConnectorComponent.java
----------------------------------------------------------------------
diff --git a/connectors/camel-connector/src/main/java/org/apache/camel/component/connector/DefaultConnectorComponent.java
b/connectors/camel-connector/src/main/java/org/apache/camel/component/connector/DefaultConnectorComponent.java
index d5c3f0b..f841ec0 100644
--- a/connectors/camel-connector/src/main/java/org/apache/camel/component/connector/DefaultConnectorComponent.java
+++ b/connectors/camel-connector/src/main/java/org/apache/camel/component/connector/DefaultConnectorComponent.java
@@ -35,6 +35,8 @@ import org.apache.camel.util.IntrospectionSupport;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.apache.camel.util.URISupport.sanitizeUri;
+
 /**
  * Base class for Camel Connector components.
  */
@@ -72,7 +74,10 @@ public abstract class DefaultConnectorComponent extends DefaultComponent
impleme
         // create the uri of the base component
         String delegateUri = createEndpointUri(scheme, options);
         Endpoint delegate = getCamelContext().getEndpoint(delegateUri);
-        log.info("Connector resolved: {} -> {}", uri, delegateUri);
+        if (log.isInfoEnabled()) {
+            // the uris can have sensitive information so sanitize
+            log.info("Connector resolved: {} -> {}", sanitizeUri(uri), sanitizeUri(delegateUri));
+        }
 
         return new DefaultConnectorEndpoint(uri, this, delegate, model.getInputDataType(),
model.getOutputDataType());
     }


Mime
View raw message