getsentry / getsentry/sentry-java

Support slf4j/logback fluent logging and key-value pairs in logback logging integration

未关闭
#5,445 5 条评论 5 个 reaction 已指派 1 人 已被 @adinauer 认领 在 GitHub 查看
Feature Java Logs Platform: Java
主要语言
Kotlin
星标
1.4k
派生
478
平均合并
2 天 23 小时
30 天内合并 PR
67

描述

### Problem Statement

We are using SLF4J fluent logging API -- https://www.slf4j.org/manual.html#fluent in a Spring Boot application using logback as implementation.

We have enabled Sentry logback integration
```
...


true
CHANGE-IT

INFO
ERROR

...
```

Dependencies:
```
...
[INFO] +- io.sentry:sentry-spring-boot-starter-jakarta:jar:8.11.1:compile
[INFO] | \- io.sentry:sentry-spring-boot-jakarta:jar:8.11.1:compile
[INFO] | +- io.sentry:sentry-spring-jakarta:jar:8.11.1:compile
[INFO] | \- io.sentry:sentry-reactor:jar:8.11.1:compile
[INFO] +- io.sentry:sentry-logback:jar:8.11.1:compile
[INFO] | \- io.sentry:sentry:jar:8.11.1:compile
...
[INFO] +- org.springframework.boot:spring-boot-starter-logging:jar:3.4.4:compile
[INFO] | +- ch.qos.logback:logback-classic:jar:1.5.18:compile
[INFO] | \- org.apache.logging.log4j:log4j-to-slf4j:jar:2.24.3:compile
[INFO] | \- org.apache.logging.log4j:log4j-api:jar:2.24.3:compile
...
[INFO] +- org.slf4j:jul-to-slf4j:jar:2.0.17:compile
[INFO] +- ch.qos.logback:logback-core:jar:1.5.18:compile
...
[INFO] +- io.sentry:sentry-logback:jar:8.11.1:compile
[INFO] | \- io.sentry:sentry:jar:8.11.1:compile
...
```

Our log messages look like this:
```
log.atError()
.addKeyValue("key1", valueInstance1)
.addKeyValue("key2", valueInstance2)
.setMessage("Error doing blah blah blah")
.setCause(ex)
.log()
```
Our problem is that in Sentry dashboard we are not seeing the key-value'd information, and instead we are only seeing the "Error doing ..." message.

In our log file we are indeed seeing these values via `... [%kvp] ...` in the file log pattern set via our `logback-spring.xml`.

Please add support for this usage pattern in the Java SDK. If this is already supported and I missed it from the documentation, please point me towards it, thanks!

### Solution Brainstorm

_No response_

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。