From 8a2ca24a006c0b45f1bd784b7c3fff67f8fafbef Mon Sep 17 00:00:00 2001 From: pvannierop Date: Tue, 10 Dec 2024 09:03:08 +0100 Subject: [PATCH] Update Sentry config Using new version of radar-commons. --- README.md | 11 ++++++++++- buildSrc/src/main/kotlin/Versions.kt | 6 +----- data-dashboard-backend/build.gradle.kts | 9 ++++++--- data-dashboard-backend/src/main/resources/log4j2.xml | 4 ++-- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 47cda15..ae54c26 100644 --- a/README.md +++ b/README.md @@ -66,4 +66,13 @@ To enable Sentry monitoring: 1. Set a `SENTRY_DSN` environment variable that points to the desired Sentry DSN. 2. (Optional) Set the `SENTRY_LOG_LEVEL` environment variable to control the minimum log level of events sent to Sentry. - The default log level for Sentry is `WARN`. Possible values are `TRACE`, `DEBUG`, `INFO`, `WARN`, and `ERROR`. + The default log level for Sentry is `ERROR`. Possible values are `TRACE`, `DEBUG`, `INFO`, `WARN`, and `ERROR`. + +For further configuration of Sentry via environmental variables see [here](https://docs.sentry.io/platforms/java/configuration/#configuration-via-the-runtime-environment). For instance: + +``` +SENTRY_LOG_LEVEL: 'ERROR' +SENTRY_DSN: 'https://000000000000.ingest.de.sentry.io/000000000000' +SENTRY_ATTACHSTACKTRACE: true +SENTRY_STACKTRACE_APP_PACKAGES: org.radarbase +``` diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 5d4e80d..2e704ee 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -24,11 +24,9 @@ object Versions { const val kotlin = "1.9.10" - const val radarCommons = "1.1.2" + const val radarCommons = "1.1.3" const val radarJersey = "0.11.1" const val postgresql = "42.6.1" - const val ktor = "2.3.5" - const val jedis = "5.0.2" const val slf4j = "2.0.9" const val log4j2 = "2.21.0" @@ -36,6 +34,4 @@ object Versions { const val jersey = "3.1.3" const val junit = "5.10.0" const val mockitoKotlin = "5.1.0" - const val hamcrest = "2.2" - const val ktlint = "1.3.1" } diff --git a/data-dashboard-backend/build.gradle.kts b/data-dashboard-backend/build.gradle.kts index 4e6a56a..a972a4c 100644 --- a/data-dashboard-backend/build.gradle.kts +++ b/data-dashboard-backend/build.gradle.kts @@ -4,9 +4,7 @@ plugins { kotlin("plugin.noarg") kotlin("plugin.jpa") kotlin("plugin.allopen") - // TODO Remove this when new release of radar-commons is available and used in this project. - // This version has Sentry support built in for radar-kotlin plugin. - id("io.sentry.jvm.gradle") version "4.11.0" + id("org.radarbase.radar-kotlin") version Versions.radarCommons } application { @@ -34,3 +32,8 @@ allOpen { annotation("jakarta.persistence.MappedSuperclass") annotation("jakarta.persistence.Embeddable") } + +radarKotlin { + log4j2Version.set(Versions.log4j2) + sentryEnabled.set(true) +} diff --git a/data-dashboard-backend/src/main/resources/log4j2.xml b/data-dashboard-backend/src/main/resources/log4j2.xml index 66bc4fc..71d9c20 100644 --- a/data-dashboard-backend/src/main/resources/log4j2.xml +++ b/data-dashboard-backend/src/main/resources/log4j2.xml @@ -32,8 +32,8 @@ - - + +