Skip to content

Commit f8185fe

Browse files
committed
Add Sentry Logging guide
1 parent c03deb5 commit f8185fe

File tree

2 files changed

+63
-1
lines changed

2 files changed

+63
-1
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
////
2+
This guide is maintained in the main Quarkus repository
3+
and pull requests should be submitted there:
4+
https://github.com/quarkusio/quarkus/tree/master/docs/src/main/asciidoc
5+
////
6+
= Quarkus - Configuring Sentry Logging
7+
8+
include::./attributes.adoc[]
9+
10+
This guide explains sentry logging and how to configure it.
11+
12+
== Run Time Configuration
13+
14+
Run time configuration of logging is done through the normal `application.properties` file.
15+
16+
include::{generated-dir}/config/quarkus-logging-sentry.adoc[opts=optional, leveloffset=+1]
17+
18+
== Description
19+
20+
Sentry is a really easy way to be notified of errors happening on you Quarkus application.
21+
22+
It is a Open Source, Self-hosted and cloud-based error monitoring that helps software teams discover, triage, and prioritize errors in real-time.
23+
24+
They offer a free starter price for cloud-based or you can self host it for free.
25+
26+
== Configuration
27+
28+
To start of, you need to get a Sentry DSN either by https://sentry.io/signup/[creating a Sentry account] or https://docs.sentry.io/server/[installing your self-hosted Sentry].
29+
30+
In order to configure Sentry logging, the `quarkus-logging-sentry` extension should be employed. Add this extension to your
31+
application POM as the following snippet illustrates.
32+
33+
.Modifications to POM file to add the Sentry logging extension
34+
[source,xml]
35+
----
36+
<build>
37+
<dependencies>
38+
<!-- ... your other dependencies are here ... -->
39+
<dependency>
40+
<groupId>io.quarkus</groupId>
41+
<artifactId>quarkus-logging-sentry</artifactId>
42+
</dependency>
43+
</dependencies>
44+
</build>
45+
----
46+
47+
== Example
48+
49+
.All errors and warnings occuring in any the packages will be sent to Sentry with DSN `https://[email protected]/1234`
50+
[source, properties]
51+
----
52+
quarkus.log.sentry.dsn=https://[email protected]/1234
53+
----
54+
55+
.All errors occuring in the package `org.example` will be sent to Sentry with DSN `https://[email protected]/1234`
56+
[source, properties]
57+
----
58+
quarkus.log.sentry.dsn=https://[email protected]/1234
59+
quarkus.log.sentry.level=ERROR
60+
quarkus.log.sentry.in-app-packages=org.example
61+
----

extensions/logging-sentry/runtime/src/main/resources/META-INF/quarkus-extension.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ metadata:
77
- "cloud"
88
categories:
99
- "core"
10-
status: "preview"
10+
status: "preview"
11+
guide: "https://quarkus.io/guides/logging-sentry"

0 commit comments

Comments
 (0)