Sentry-java: Support for java.util.logging (jul)

Created on 10 Nov 2020  路  8Comments  路  Source: getsentry/sentry-java

_Platform:_

  • [ ] Android -> If yes, which Device API (and compileSdkVersion/targetSdkVersion/Build tools) version?
  • [x ] Java -> If yes, which Java 11
  • [ ] Kotlin -> If yes, which Kotlin (and jvmTarget) version?
  • [ ] NDK -> If yes, which NDK/CMake version?
  • [ ] React-Native -> If yes, which version?
  • [ ] Timber -> If yes, which version?
  • [x ] Log4j2 -> If yes, which version? 3.13
  • [ ] Logback -> If yes, which version?
  • [ ] Spring -> If yes, which version?

_IDE:_

  • [ ] Android Studio -> If yes, which version?
  • [x ] IntelliJ -> If yes, which version? 2020.2
  • [ ] Other -> If yes, which one?

_Build system:_

  • [ ] Gradle -> If yes, which version?
  • [ ] Buck -> If yes, which version?
  • [ ] Bazel -> If yes, which version?
  • [x ] Maven -> If yes, which version?
  • [ ] Other -> If yes, which one?

_Android Gradle Plugin:_

  • [ ] Yes -> If yes, which version?
  • [ x] No

_Sentry Android Gradle Plugin:_

  • [ ] Yes -> If yes, which version?
  • [x ] No

_Proguard/R8:_

  • [ ] Enabled
  • [x ] Disabled

_Platform installed with:_

  • [ ] JCenter
  • [ ] Bintray
  • [x ] Maven Central
  • [ ] Manually

The version of the SDK:
3.x.x


I have the following issue:
The legacyAPI contained a java.util.logging Logger Handler named io.sentry.jul.SentryHander. This class has been dropped for API 3.x.x Is there a specific reasoning for this?
The lack of such a handler makes the integration of Sentry into wildfly much more difficult (if you want Sentry to be active during startup/deployment) because the wildfly container only allows custom handlers that extend java.util.logging.Handler (ref)

Steps to reproduce:
Checkout the new java-sentry api

Actual result:
There is no jul handler.

Expected result:
A handler extending java.util.logger.Handler should exist

enhancement

Most helpful comment

We also are in need of a jul SentryHandler tu update the Quarkus Sentry extension with the most recent version of sentry.

All 8 comments

Thanks for reporting. JUL integration will be re-added in one of the upcoming versions.

Thanks this is great news! I am looking forward to it.

@maciejwalkowiak is there any status in this?

@tlf30 not yet, we're focused on the performance feature for this Q.

We accept PRs, happy to guide you if you wish to do a contribution :)

We also are in need of a jul SentryHandler tu update the Quarkus Sentry extension with the most recent version of sentry.

We're going to work on this once 4.0.0 GA is out (soon).

@bruno-garcia @mh03r932 if that helps, I created a temporary implementation of SentryHandler compatible with 3.2.0 for Quarkus that you can start from:
https://github.com/ia3andy/quarkus/blob/update-sentry-version/extensions/logging-sentry/runtime/src/main/java/io/quarkus/logging/sentry/SentryHandler.java

I added the SentryOptions as a field because I need it for testing purpose but it could be removed. btw it would be nice to be able to access the current SentryOptions directly from Sentry.getCurrentOptions()

@maciejwalkowiak let's close it once docs are also out there, otherwise, it could be easily forgotten, if that's ok

Was this page helpful?
0 / 5 - 0 ratings