logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattsic...@apache.org
Subject svn commit: r1601538 - in /logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors: PluginAttributeVisitor.java PluginBuilderAttributeVisitor.java
Date Tue, 10 Jun 2014 01:00:48 GMT
Author: mattsicker
Date: Tue Jun 10 01:00:48 2014
New Revision: 1601538

URL: http://svn.apache.org/r1601538
Log:
Add support for sensitive attributes to the usual annotations.

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/PluginAttributeVisitor.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/PluginBuilderAttributeVisitor.java

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/PluginAttributeVisitor.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/PluginAttributeVisitor.java?rev=1601538&r1=1601537&r2=1601538&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/PluginAttributeVisitor.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/PluginAttributeVisitor.java
Tue Jun 10 01:00:48 2014
@@ -23,6 +23,7 @@ import org.apache.logging.log4j.core.Log
 import org.apache.logging.log4j.core.config.Configuration;
 import org.apache.logging.log4j.core.config.Node;
 import org.apache.logging.log4j.core.config.plugins.PluginAttribute;
+import org.apache.logging.log4j.core.util.NameUtil;
 
 /**
  * PluginVisitor implementation for {@link PluginAttribute}.
@@ -40,7 +41,8 @@ public class PluginAttributeVisitor exte
         final String replacedValue = this.substitutor.replace(event, rawValue);
         final Object defaultValue = findDefaultValue(event);
         final Object value = convert(replacedValue, defaultValue);
-        LOGGER.debug("Attribute({}=\"{}\")", name, value);
+        final Object debugValue = this.annotation.sensitive() ? NameUtil.md5(value + this.getClass().getName())
: value;
+        LOGGER.debug("Attribute({}=\"{}\")", name, debugValue);
         return value;
     }
 

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/PluginBuilderAttributeVisitor.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/PluginBuilderAttributeVisitor.java?rev=1601538&r1=1601537&r2=1601538&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/PluginBuilderAttributeVisitor.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/visitors/PluginBuilderAttributeVisitor.java
Tue Jun 10 01:00:48 2014
@@ -23,6 +23,7 @@ import org.apache.logging.log4j.core.Log
 import org.apache.logging.log4j.core.config.Configuration;
 import org.apache.logging.log4j.core.config.Node;
 import org.apache.logging.log4j.core.config.plugins.PluginBuilderAttribute;
+import org.apache.logging.log4j.core.util.NameUtil;
 
 /**
  * PluginVisitor for PluginBuilderAttribute. If {@code null} is returned for the
@@ -45,7 +46,8 @@ public class PluginBuilderAttributeVisit
         final String rawValue = removeAttributeValue(attributes, name, this.aliases);
         final String replacedValue = this.substitutor.replace(event, rawValue);
         final Object value = convert(replacedValue, null);
-        LOGGER.debug("Attribute({}=\"{}\")", name, value);
+        final Object debugValue = this.annotation.sensitive() ? NameUtil.md5(value + this.getClass().getName())
: value;
+        LOGGER.debug("Attribute({}=\"{}\")", name, debugValue);
         return value;
     }
 }



Mime
View raw message