Quarkus - Logging to Sentry
This guide explains how to configure Quarkus to log to Sentry.
Sentry is a really easy way to be notified of errors happening in your Quarkus application.
It is a self-hosted and cloud-based error monitoring that helps software teams discover, triage, and prioritize errors in real-time.
They offer a free starter price for cloud-based or you can self host it for free.
In order to configure Sentry logging, add the
to your project by running the following command in your project base directory:
./mvnw quarkus:add-extension -Dextensions="logging-sentry"
This will add the following to your
<dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-logging-sentry</artifactId> </dependency>
Sentry differentiates stack frames that are directly related to your application (“in application”) from stack frames that come from other packages such as the standard library, frameworks, or other dependencies. The difference is visible in the Sentry web interface where only the “in application” frames are displayed by default.
You can configure which package prefixes your application uses with the
in-app-packages option, which takes a comma separated list of packages:
If you don’t want to use this feature but want to disable the warning, simply set it to
quarkus.log.sentry=true quarkus.log.sentry.dsn=https://email@example.com/1234 quarkus.log.sentry.in-app-packages=*
org.examplewill be sent to Sentry with DSN
quarkus.log.sentry=true quarkus.log.sentry.dsn=https://firstname.lastname@example.org/1234 quarkus.log.sentry.level=ERROR quarkus.log.sentry.in-app-packages=org.example