Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ kotlin-compatible-version = "1.9"
ksp = "2.3.9"
ktorClient = "3.0.0"
logback = "1.2.9"
log4j2 = "2.20.0"
log4j2 = "2.26.1"
nopen = "1.0.1"
# see https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compatibility-and-versioning.html#kotlin-compatibility
# see https://developer.android.com/jetpack/androidx/releases/compose-kotlin
Expand Down
10 changes: 10 additions & 0 deletions sentry-log4j2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ tasks.withType<JavaCompile>().configureEach {
}
}

// log4j's GraalVmProcessor warns (and fails the build under -Werror) without these options
tasks.named<JavaCompile>("compileJava") {
options.compilerArgs.addAll(
listOf(
"-Alog4j.graalvm.groupId=${project.group}",
"-Alog4j.graalvm.artifactId=${project.name}",
)
)
}

tasks.jar {
manifest {
attributes(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ public void append(final @NotNull LogEvent eventObject) {
* @param loggingEvent the log4j2 event
*/
// for the Android compatibility we must use old Java Date class
@SuppressWarnings("JdkObsolete")
// Message.getFormat() is deprecated since log4j 2.24.0 without a replacement for reading the
// message template
@SuppressWarnings({"JdkObsolete", "deprecation"})
protected void captureLog(@NotNull LogEvent loggingEvent) {
final @NotNull SentryLogLevel sentryLevel = toSentryLogLevel(loggingEvent.getLevel());

Expand Down Expand Up @@ -274,7 +276,9 @@ protected void captureLog(@NotNull LogEvent loggingEvent) {
* @return the sentry event
*/
// for the Android compatibility we must use old Java Date class
@SuppressWarnings("JdkObsolete")
// Message.getFormat() is deprecated since log4j 2.24.0 without a replacement for reading the
// message template
@SuppressWarnings({"JdkObsolete", "deprecation"})
protected @NotNull SentryEvent createEvent(final @NotNull LogEvent loggingEvent) {
final SentryEvent event = new SentryEvent(DateUtils.getDateTime(loggingEvent.getTimeMillis()));
final Message message = new Message();
Expand Down
Loading