mirror of https://github.com/apache/activemq.git
https://issues.apache.org/activemq/browse/AMQ-2499 - don't show passwords in log files
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@881274 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a55efe952c
commit
1466d6cc3a
|
@ -262,23 +262,28 @@ public final class IntrospectionSupport {
|
|||
boolean first = true;
|
||||
for (Iterator iter = entrySet.iterator(); iter.hasNext();) {
|
||||
Map.Entry entry = (Map.Entry)iter.next();
|
||||
Object value = entry.getValue();
|
||||
Object key = entry.getKey();
|
||||
if (first) {
|
||||
first = false;
|
||||
} else {
|
||||
buffer.append(", ");
|
||||
}
|
||||
buffer.append(entry.getKey());
|
||||
buffer.append(key);
|
||||
buffer.append(" = ");
|
||||
appendToString(buffer, entry.getValue());
|
||||
|
||||
appendToString(buffer, key, value);
|
||||
}
|
||||
buffer.append("}");
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
protected static void appendToString(StringBuffer buffer, Object value) {
|
||||
protected static void appendToString(StringBuffer buffer, Object key, Object value) {
|
||||
if (value instanceof ActiveMQDestination) {
|
||||
ActiveMQDestination destination = (ActiveMQDestination)value;
|
||||
buffer.append(destination.getQualifiedName());
|
||||
} else if (key.toString().contains("password")){
|
||||
buffer.append("*****");
|
||||
} else {
|
||||
buffer.append(value);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue