Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Sentry client for Grails
Groovy Shell
branch: master

This branch is 108 commits ahead, 2 commits behind informant-army:master


Build Status

Raven is a Grails client for integrating apps with Sentry. Sentry is an event logging platform primarily focused on capturing and aggregating exceptions.

It uses the official Raven-java client under the cover.


Add the following to your BuildConfig.groovy:

plugins {
    compile ":raven:"


You need to provide your Sentry DSN in Config.groovy file. The plugin will sent notifications to Sentry by default, if you want to disable notifications for an specific environment set the active option as false. You can also configure the multiple logger to which you want to append the sentry appender. You can also set the server name, but it is recommended to don't set this configuration and let the plugin to resolve it.

grails.plugin.raven.dsn = "https://{PUBLIC_KEY}:{SECRET_KEY}{PATH}{PROJECT_ID}"

environments {
    test { = false
    development { = false
    production {

Optional configurations

grails.plugin.raven.loggers = ["LOGGER1","LOGGER2","LOGGER3"]
grails.plugin.raven.serverName = ""
grails.plugin.raven.levels = ["ERROR","FATAL"] // Defaults to ERROR,WARN,FATAL

grails.plugin.raven.tags = ["tag1" : "val1",
                            "tag2" : "val2",
                            "tag3" : "val3"]

grails.plugin.raven.subsystems = ["MODULE1" : ["", ""],
                                  "MODULE2" : ["", ""],
                                  "MODULE3" : ["", ""]]

grails.plugin.raven.logClassName = true
grails.plugin.raven.priorities = ["HIGH" :  ["java.lang", ""],
                                  "MID"  :  [""],
                                  "LOW"  :  [""]]

Check Raven-java documentation to configure connection, protocol and async options in your DSN. If you are sending extra tags from the plugin for the exceptions, make sure to enable the corresponding tag on sentry tag settings for the particular project to see the tag as a filter on the exception stream on sentry.


Log4j Appender

The Log4j Appender is automatically configured by plugin, you have just to set enabled environments in Config.groovy file as shown in Configuration section. All application exceptions will be logged on sentry by the appender. The appender is configured to log just the ERROR, WARN and FATAL levels. To log manually just use the log.error method.


You also can use raven client to sent info messages to Sentry:

import net.kencochrane.raven.Raven
import net.kencochrane.raven.event.Event
import net.kencochrane.raven.event.EventBuilder

Raven raven // To inject Spring bean raven client in your controllers or services

// Send simple message
raven?.sendMessage("some message")

// Send exception
raven?.sendException(new Exception("some exception"))

// Custom event
EventBuilder eventBuilder = new EventBuilder(
        message: "Hello from Raven!",
        level: Event.Level.ERROR,
        new ExceptionInterface(
                new Exception("some exception")

Latest releases

  • 2015-03-19 V6.0.0.4 : additional config options (thanks to Anuj Kulkarni) and versioning aligned to java lib
  • 2015-03-11 V6.1.3 : additional config options (thanks to Anuj Kulkarni)
  • 2015-02-17 V6.1.2 : new config options (thanks to Anuj Kulkarni)
  • 2015-02-12 V6.1.1 : bug fix
  • 2015-02-12 V6.1.0 : new setting to configure the logger to which you want to append the sentry appender (thanks to Anuj Kulkarni)
  • 2015-01-29 V6.0.0 : major refactor to use the official Raven-java client

WARNING: Breaking change, since V6.0.0, if you were using the legacy groovy-based ravenClient spring bean, you must replace it with the new java-based raven client spring bean and sendMessage or sendException methods.

  • 2014-03-08 V0.5.8 : PR by jglapa for improved user data handling + bug fix
  • 2014-03-05 V0.5.7 : PR by Logicopolis for async execution
  • 2014-01-03 V0.5.4 : PR by benorama to remove commons codec Base64 dependency when building message body (for Grails 2.3 compatibility)
  • 2012-12-12 V0.5 : refactoring
  • 2012-12-10 V0.4 : sentryClient Spring Bean
  • 2012-11-23 V0.2 : user interface + bug fixes
  • 2012-10-29 V0.1 : initial release


To report any bug, please use the project Issues section on GitHub.

Something went wrong with that request. Please try again.