{ "html": "
Using Maven:
\n<dependency>\n <groupId>io.sentry</groupId>\n <artifactId>sentry-logback</artifactId>\n <version>1.6.3</version>\n</dependency>\n
Using Gradle:
\ncompile 'io.sentry:sentry-logback:1.6.3'\n
Using SBT:
\nlibraryDependencies += "io.sentry" % "sentry-logback" % "1.6.3"\n
For other dependency managers see the central Maven repository.
\nThe following example configures a ConsoleAppender
that logs to standard out\nat the INFO
level and a SentryAppender
that logs to the Sentry server at\nthe WARN
level. The ConsoleAppender
is only provided as an example of\na non-Sentry appender that is set to a different logging threshold, like one you\nmay already have in your project.
Example configuration using the logback.xml
format:
<configuration>\n <!-- Configure the Console appender -->\n <appender name="Console" class="ch.qos.logback.core.ConsoleAppender">\n <encoder>\n <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>\n </encoder>\n </appender>\n\n <!-- Configure the Sentry appender, overriding the logging threshold to the WARN level -->\n <appender name="Sentry" class="io.sentry.logback.SentryAppender">\n <filter class="ch.qos.logback.classic.filter.ThresholdFilter">\n <level>WARN</level>\n </filter>\n </appender>\n\n <!-- Enable the Console and Sentry appenders, Console is provided as an example\n of a non-Sentry logger that is set to a different logging threshold -->\n <root level="INFO">\n <appender-ref ref="Console" />\n <appender-ref ref="Sentry" />\n </root>\n</configuration>\n
Next, you’ll need to configure your DSN (client key) and optionally other values such as\nenvironment
and release
. See the configuration page for ways you can do this.