From 09dfc0e645a11434428091f9aa3faeab32106241 Mon Sep 17 00:00:00 2001 From: Andy Damevin Date: Mon, 2 Dec 2019 16:25:29 +0100 Subject: [PATCH] Add Sentry Logging guide --- docs/src/main/asciidoc/logging-sentry.adoc | 63 +++++++++++++++++++ .../resources/META-INF/quarkus-extension.yaml | 3 +- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 docs/src/main/asciidoc/logging-sentry.adoc diff --git a/docs/src/main/asciidoc/logging-sentry.adoc b/docs/src/main/asciidoc/logging-sentry.adoc new file mode 100644 index 00000000000000..33eaf588b86eee --- /dev/null +++ b/docs/src/main/asciidoc/logging-sentry.adoc @@ -0,0 +1,63 @@ +//// +This guide is maintained in the main Quarkus repository +and pull requests should be submitted there: +https://github.com/quarkusio/quarkus/tree/master/docs/src/main/asciidoc +//// += Quarkus - Configuring Sentry Logging + +include::./attributes.adoc[] + +This guide explains sentry logging and how to configure it. + +== Run Time Configuration + +Run time configuration of logging is done through the normal `application.properties` file. + +include::{generated-dir}/config/quarkus-logging-sentry.adoc[opts=optional, leveloffset=+1] + +== Description + +Sentry is a really easy way to be notified of errors happening on you Quarkus application. + +It is a Open Source, 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. + +== Configuration + +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]. + +In order to configure Sentry logging, the `quarkus-logging-sentry` extension should be employed. Add this extension to your +application POM as the following snippet illustrates. + +.Modifications to POM file to add the Sentry logging extension +[source,xml] +---- + + + + + io.quarkus + quarkus-logging-sentry + + + +---- + +== Example + +.All errors and warnings occuring in any the packages will be sent to Sentry with DSN `https://abcd@sentry.io/1234` +[source, properties] +---- +quarkus.log.sentry=true +quarkus.log.sentry.dsn=https://abcd@sentry.io/1234 +---- + +.All errors occuring in the package `org.example` will be sent to Sentry with DSN `https://abcd@sentry.io/1234` +[source, properties] +---- +quarkus.log.sentry=true +quarkus.log.sentry.dsn=https://abcd@sentry.io/1234 +quarkus.log.sentry.level=ERROR +quarkus.log.sentry.in-app-packages=org.example +---- diff --git a/extensions/logging-sentry/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/logging-sentry/runtime/src/main/resources/META-INF/quarkus-extension.yaml index a92de8ea4fc95d..a33c51adf5586e 100644 --- a/extensions/logging-sentry/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/logging-sentry/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -7,4 +7,5 @@ metadata: - "cloud" categories: - "core" - status: "preview" \ No newline at end of file + status: "preview" + guide: "https://quarkus.io/guides/logging-sentry" \ No newline at end of file