Revisit log4j2 Message.getFormat() deprecation for v9

Abierto
#6,377 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
1-2 días
Aptitud para principiantes
48/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Kotlin
Estrellas
1.4k
Forks
483
Merge medio
2 d 2 h
PR fusionados (30 d)
202

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de getsentry/sentry-java

Todos los issues de getsentry/sentry-java

Issues similares

Más issues de Kotlin

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.