Skip to content

Commit ccdb7e6

Browse files
adinauerclaude
andcommitted
docs(logback): Clarify unencoded message behavior
Describe how encoder use, the integration opt-in, and the legacy PII option control original message data. Refs #5666 Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 29b109f commit ccdb7e6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎sentry-logback/src/main/java/io/sentry/logback/SentryAppender.java‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ protected void append(@NotNull ILoggingEvent eventObject) {
118118
final SentryEvent event = new SentryEvent(DateUtils.getDateTime(loggingEvent.getTimeStamp()));
119119
final Message message = new Message();
120120

121-
// if encoder is set we treat message+params as PII as encoders may be used to mask/strip PII
121+
// Encoders may mask or strip PII. When one is configured, include the original message and
122+
// parameters only if includeUnencodedMessage or the legacy sendDefaultPii option is enabled.
122123
if (shouldIncludeUnencodedMessage()) {
123124
message.setMessage(loggingEvent.getMessage());
124125
message.setParams(toParams(loggingEvent.getArgumentArray()));
@@ -177,7 +178,8 @@ protected void captureLog(@NotNull ILoggingEvent loggingEvent) {
177178
final @NotNull SentryAttributes attributes = SentryAttributes.of();
178179
final @NotNull String formattedMessage = formatted(loggingEvent);
179180

180-
// if encoder is set we treat message+params as PII as encoders may be used to mask/strip PII
181+
// Encoders may mask or strip PII. When one is configured, include the original message and
182+
// parameters only if includeUnencodedMessage or the legacy sendDefaultPii option is enabled.
181183
if (shouldIncludeUnencodedMessage()) {
182184
final @Nullable String nonFormattedMessage = loggingEvent.getMessage();
183185
if (nonFormattedMessage != null && !formattedMessage.equals(nonFormattedMessage)) {

0 commit comments

Comments
 (0)