ARTEMIS-3172 don't log STOMP CONNECT passcode header

This commit is contained in:
Justin Bertram 2021-03-10 09:24:10 -06:00
parent d718a9dd32
commit e1669d4ad2
1 changed files with 6 additions and 1 deletions

View File

@ -20,6 +20,7 @@ import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
import org.apache.activemq.artemis.api.core.ActiveMQBuffers;
@ -79,7 +80,11 @@ public class StompFrame {
public String toString() {
StringBuilder result = new StringBuilder()
.append("StompFrame[command=").append(command)
.append(", headers=").append(headers);
.append(", headers=").append(headers
.keySet()
.stream()
.map(key -> key + "=" + (key.equals(Stomp.Headers.Connect.PASSCODE) ? "****" : headers.get(key)))
.collect(Collectors.joining(", ", "{", "}")));
if (command.equals(Stomp.Responses.MESSAGE) || command.equals(Stomp.Responses.ERROR) || command.equals(Stomp.Commands.SEND)) {
result.append(", body=").append(this.getBody())