Revisit log4j2 Message.getFormat() deprecation for v9

未关闭
#6,377 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
1-2 天
新手友好度
48/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃
技术栈
java
领域
backend

调研方向

Start with SentryAppender.captureLog and SentryAppender.createEvent in sentry-log4j2/src/main/java/io/sentry/log4j2/SentryAppender.java, then review the Log4j message interfaces and implementations mentioned in the issue. Determine how to preserve the unformatted template without relying on the deprecated method, and verify both the sentry.message.template attribute and event message behavior.

由索引模型根据 Issue 内容生成。

描述

Next Major Platform: Java

Log4j 2.24.0 deprecated org.apache.logging.log4j.message.Message.getFormat(), and sentry-log4j2 still calls it to get the unformatted message template. The deprecation warning is suppressed in getsentry/sentry-java#5435 (log4j2 2.20.0 → 2.26.1) to keep the build passing under -Xlint:all -Werror.

  • Call sites: SentryAppender.captureLog (populates the sentry.message.template log attribute) and SentryAppender.createEvent (sets Message.message on events) in sentry-log4j2/src/main/java/io/sentry/log4j2/SentryAppender.java.
  • The deprecation note points to MultiformatMessage for implementing messages. It does not offer a replacement for reading a message's template, and getFormattedMessage() drops the template.
  • In 2.26.1 the interface method is a default that returns null. Concrete classes such as ParameterizedMessage, ReusableParameterizedMessage, StringFormattedMessage, MessageFormatMessage and SimpleMessage still override it without a deprecation.
  • Log4j 3 has only reached 3.0.0-beta3; no stable 3.0 is listed in the Apache release catalog.

Proposed by Nelson Osacky: suppress the warning now and revisit the call in the next major.

Action taken on behalf of Nelson Osacky.

主要语言
Kotlin
星标
1.4k
派生
483
平均合并
2 天 2 小时
30 天内合并 PR
202

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

getsentry/sentry-java 的其他 Issue

查看 getsentry/sentry-java 的全部 Issue

相似的 Issue

更多 Kotlin Issue

把新 issue 发到你的邮箱

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