Add the sentry SDK to your project.
Using Gradle:
implementation 'io.sentry:sentry:8.+'
Using Maven:
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry</artifactId>
<version>LATEST</version>
</dependency>
Configure the SentryHandler in your logging.properties:
handlers=java.util.logging.ConsoleHandler,io.sentry.jul.SentryHandler
.level=INFO
io.sentry.jul.SentryHandler.level=WARNING
Start your application with the logging config:
java -Djava.util.logging.config.file=/path/to/logging.properties MyClass
Set your DSN via environment variable:
export SENTRY_DSN="YOUR_DSN"
Log messages at WARNING level and above will be sent to GlitchTip as error events.