Dropwizard integration for error logging to Sentry.
Clone or download
Pull request Compare This branch is 22 commits ahead of tradier:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Dropwizard Sentry

Build Status Coverage Status Maven Central Javadocs

Dropwizard integration for error logging to Sentry.


Dropwizard Sentry provides an AppenderFactory which is automatically registered in Dropwizard and will send errors to Sentry.

Logging startup errors

In order to log startup errors (i.e. before the SentryAppenderFactory has been properly initialized), the Dropwizard application has to run the SentryBootstrap.bootstrap() in its main method and set a custom UncaughtExceptionHandler for the main thread.

public static void main(String[] args) throws Exception {

    new MyDropwizardApplication().run(args);


Include the sentry appender in your application's YAML configuration:

  - type: sentry
    threshold: ERROR
    dsn: https://user:pass@sentry.io/appid
    environment: production
    mdcTags: ['foo','bar','baz']
    sentryClientFactory: com.example.SentryClientFactory
    release: 1.0.0
    extra: {key1:'value1',key2:'value2'}
    stacktraceAppPackages: ['com.example','com.foo']
Setting Default Description Example Value
threshold ALL The log level to configure to send to Sentry ERROR
dsn Data Source Name - format is https://{PUBLIC_KEY}:{SECRET_KEY}@sentry.io/{PROJECT_ID} https://foo:bar@sentry.io/12345
environment [empty] The environment your application is running in production
tags [empty] Tags to be sent with each event tag1:value1,tag2,value2
mdcTags [empty] Tag names to be extracted from logging MDC ['foo', 'bar']
sentryClientFactory [empty] Specify a custom SentryClientFactory class com.example.SentryClientFactory
release [empty] The release version of your application 1.0.0
serverName [empty] Override the server name (rather than looking it up dynamically)
extra [empty] Extra data to be sent with errors (but not as tags) {key1:'value1',key2:'value2'}
stacktraceAppPackages [empty] List of package prefixes used by application code ['com.example','com.foo']

If you need to set configuration properties not listed above, append them to the dsn as described here.

Maven Artifacts

This project is available in the Central Repository. To add it to your project simply add the following dependency to your POM:



Please file bug reports and feature requests in GitHub issues.


Thanks to dropwizard-raven from which much of the original implementation was derived.