diff --git a/README.md b/README.md
index 948635a..ad7d0e2 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Airbrake Plugin for Grails
+# Airbrake Plugin for Grails 3.1.4 > *
This is the notifier plugin for integrating grails apps with [Airbrake](http://airbrake.io).
@@ -6,13 +6,20 @@ When an uncaught exception occurs, Airbrake will POST the relevant data to the A
## Installation & Configuration
-Add the following to your `BuildConfig.groovy`
+Add the following to your `build.gradle`
```
-compile ":airbrake:0.9.4"
+repositories {
+ ...
+ maven { url "http://dl.bintray.com/marcatriflmedia/plugins" }
+}
+```
+
+```
+compile "grails.plugins:airbrake-grails-3.1:1.0.2"
```
-Once the plugin is installed, you need to provide your Api Key in `Config.groovy` file:
+Once the plugin is installed, you need to provide your Api Key in `application.groovy` file:
```groovy
grails.plugins.airbrake.apiKey = 'YOUR_API_KEY'
@@ -83,7 +90,7 @@ grails.plugins.airbrake.excludes
```
### Enabling/Disabling Notifications
-By default all errors are sent to Airbrake. However, you can disable error notifications (essentially disabling the plugin) by setting `grails.plugins.airbrake.enabled = false`. For example to disable error notificaitons in development and test environments you might have the following in `Config.groovy`:
+By default all errors are sent to Airbrake. However, you can disable error notifications (essentially disabling the plugin) by setting `grails.plugins.airbrake.enabled = false`. For example to disable error notificaitons in development and test environments you might have the following in `application.groovy`:
```groovy
grails.plugins.airbrake.apiKey = 'YOUR_API_KEY'
@@ -128,7 +135,7 @@ grails.plugins.airbrake.env = grails.util.Environment.current.name[0..0] // Airb
By default only uncaught errors or errors logged with an exception are reported to Airbrake. It is often convenient to loosen that restriction so that all messages logged at the `Error` level are reported to Airbrake. This often most useful in `src/java` or `src/groovy` classes that can more easily have a log4j logger than get accees to the dependency injected `airbrakeService`.
-With the following line in `Config.groovy`:
+With the following line in `application.groovy`:
```groovy
grails.plugins.airbrake.includeEventsWithoutExceptions = true
@@ -225,7 +232,7 @@ This configuration takes a closure with two parameters the `Notice` to send and
This plugin does not introduce a default choice for processing notices asynchronously. You should choose a method that suits your application.
You could just create a new thread or use a scheduler/queuing plugin such as [Quartz](http://grails.org/plugin/quartz) or [Jesque](http://grails.org/plugin/jesque)
-For example if you are using the Quartz plugin you can send notifications asynchronously using the following setting in `Config.groovy`
+For example if you are using the Quartz plugin you can send notifications asynchronously using the following setting in `application.groovy`
```groovy
grails.plugins.airbrake.async = { notice, grailsApplication ->
@@ -250,7 +257,7 @@ class AirbrakeNotifyJob {
### Stack Trace Filtering
By default all stack traces are filtered using an instance of `org.codehaus.groovy.grails.exceptions.DefaultStackTraceFilterer` to remove common Grails and java packages.
-To provide custom stack trace filtering simple configure an instance of a class that implements the interface `org.codehaus.groovy.grails.exceptions.StackTraceFilterer` in `Config.groovy`
+To provide custom stack trace filtering simple configure an instance of a class that implements the interface `org.codehaus.groovy.grails.exceptions.StackTraceFilterer` in `application.groovy`
```groovy
grails.plugins.airbrake.stackTraceFilterer = new MyCustomStackTraceFilterer()
@@ -265,6 +272,10 @@ A backport to Grails 2.2 is available on the [grails-2.2 branch] (https://github
## Release Notes
+* 1.0.2 - 2016/04/11
+ * Fix AirbrakeAppender for Grails 3.1.4.
+* 1.0.1 - 2016/04/11
+ * Support for Grails 3.1.4.
* 1.0.0.RC1 - 2015/07/27
* Support for Grails 3.0. #40
* 0.9.4 - 2013/06/25
diff --git a/build.gradle b/build.gradle
index afae024..d4774e3 100644
--- a/build.gradle
+++ b/build.gradle
@@ -11,38 +11,22 @@ buildscript {
}
}
-plugins {
- id "io.spring.dependency-management" version "0.5.2.RELEASE"
- id "com.jfrog.bintray" version "1.2"
-}
-
-version "1.0.0.RC1"
-group "org.grails.plugins"
-//ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
+version "1.0.2"
+group "grails.plugins"
-apply plugin: 'maven-publish'
-apply plugin: 'eclipse'
-apply plugin: 'idea'
-apply plugin: "spring-boot"
-apply plugin: "org.grails.grails-plugin"
-apply plugin: "org.grails.grails-gsp"
-// Used for publishing to central repository, remove if not needed
-apply from:'https://raw.githubusercontent.com/grails/grails-profile-repository/master/profiles/plugin/templates/grailsCentralPublishing.gradle'
-apply from:'https://raw.githubusercontent.com/grails/grails-profile-repository/master/profiles/plugin/templates/bintrayPublishing.gradle'
+apply plugin:"eclipse"
+apply plugin:"idea"
+apply plugin:"org.grails.grails-plugin"
+apply plugin:"org.grails.grails-plugin-publish"
+apply plugin:"org.grails.grails-gsp"
ext {
grailsVersion = project.grailsVersion
gradleWrapperVersion = project.gradleWrapperVersion
}
-sourceCompatibility = 1.7
-targetCompatibility = 1.7
-
-
repositories {
mavenLocal()
- mavenCentral()
- jcenter()
maven { url "https://repo.grails.org/grails/core" }
}
@@ -54,37 +38,37 @@ dependencyManagement {
}
dependencies {
- provided 'org.springframework.boot:spring-boot-starter-logging'
- provided "org.springframework.boot:spring-boot-starter-actuator"
- provided "org.springframework.boot:spring-boot-autoconfigure"
- provided "org.springframework.boot:spring-boot-starter-tomcat"
-
- provided "org.grails:grails-web-boot"
- provided "org.grails:grails-dependencies"
- provided 'javax.servlet:javax.servlet-api:3.1.0'
-
- testCompile "org.grails:grails-plugin-testing"
-
+ compile "org.springframework.boot:spring-boot-starter-logging"
+ compile "org.springframework.boot:spring-boot-autoconfigure"
+ compile "org.grails:grails-core"
+ compile "org.springframework.boot:spring-boot-starter-actuator"
+ compile "org.springframework.boot:spring-boot-starter-tomcat"
+ compile "org.grails:grails-dependencies"
+ compile "org.grails:grails-web-boot"
+ compile "org.grails.plugins:cache"
+ compile "org.grails.plugins:scaffolding"
console "org.grails:grails-console"
+ profile "org.grails.profiles:web-plugin:3.1.4"
+ provided "org.grails:grails-plugin-services"
+ provided "org.grails:grails-plugin-domain-class"
+ testCompile "org.grails:grails-plugin-testing"
+ testCompile "org.grails.plugins:geb"
+ testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
+ testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
}
task wrapper(type: Wrapper) {
gradleVersion = gradleWrapperVersion
}
-
-bintray {
- pkg {
- userOrg = ''
- name = 'airbrake-grails'
- desc = 'Airbrake Client for Grails'
- websiteUrl = 'https://github.com/cavneb/airbrake-grails'
- issueTrackerUrl = 'https://github.com/cavneb/airbrake-grails/issues'
- vcsUrl = 'https://github.com/cavneb/airbrake-grails'
- licenses = ['Apache-2.0']
- version {
- attributes = ['grails-plugin': "airbrake-grails"]
- name = project.version
- }
- publicDownloadNumbers = true
+grailsPublish {
+ // TODO: Provide values here
+ user = ''
+ key = ''
+ githubSlug = 'foo/bar'
+ license {
+ name = 'Apache-2.0'
}
+ title = "Airbrake-3.1"
+ desc = "Grails Airbrake plugin compatible with version 3.1.4 > *"
+ developers = [marcatriflmedia:"Marc-Emmanuel Ramage"]
}
diff --git a/gradle.properties b/gradle.properties
index b07f2cc..b6709f3 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,2 +1,2 @@
-grailsVersion=3.0.3
-gradleWrapperVersion=2.3
+grailsVersion=3.1.4
+gradleWrapperVersion=2.9
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index c97a8bd..9411448 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 2bdcf31..d15e30c 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Wed Feb 04 17:05:29 CST 2015
+#Mon Apr 11 02:22:43 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-all.zip
diff --git a/gradlew b/gradlew
index 91a7e26..9d82f78 100755
--- a/gradlew
+++ b/gradlew
@@ -42,11 +42,6 @@ case "`uname`" in
;;
esac
-# For Cygwin, ensure paths are in UNIX format before anything is touched.
-if $cygwin ; then
- [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-fi
-
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
@@ -61,9 +56,9 @@ while [ -h "$PRG" ] ; do
fi
done
SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >&-
+cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
-cd "$SAVED" >&-
+cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -114,6 +109,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
diff --git a/gradlew.bat b/gradlew.bat
index 8a0b282..aec9973 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -1,90 +1,90 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/grails-app/conf/application.groovy b/grails-app/conf/application.groovy
new file mode 100644
index 0000000..bf107ef
--- /dev/null
+++ b/grails-app/conf/application.groovy
@@ -0,0 +1,6 @@
+// configuration for plugin testing - will not be included in the plugin zip
+grails.plugins.airbrake.apiKey = 'YOUR_API_KEY'
+grails.plugins.airbrake.paramsFilteredKeys = ['password']
+grails.plugins.airbrake.sessionFilteredKeys = ['password']
+grails.plugins.airbrake.cgiDataFilteredKeys = ['password']
+grails.plugins.airbrake.includeEventsWithoutExceptions = true
diff --git a/grails-app/conf/application.yml b/grails-app/conf/application.yml
index b905550..64505b5 100644
--- a/grails-app/conf/application.yml
+++ b/grails-app/conf/application.yml
@@ -2,13 +2,17 @@
grails:
profile: web-plugin
codegen:
- defaultPackage: airbrake.grails
+ defaultPackage: grails.plugins
+ spring:
+ transactionManagement:
+ proxies: false
info:
app:
- name: 'airbrake-grails'
- version: '1.0.0.RC1'
- grailsVersion: '3.0.3'
+ name: '@info.app.name@'
+ version: '@info.app.version@'
+ grailsVersion: '@info.app.grailsVersion@'
spring:
+
groovy:
template:
check-template-location: false
@@ -30,7 +34,7 @@ grails:
css: text/css
csv: text/csv
form: application/x-www-form-urlencoded
- html:
+ html:
- text/html
- application/xhtml+xml
js: text/javascript
@@ -38,9 +42,10 @@ grails:
- application/json
- text/json
multipartForm: multipart/form-data
+ pdf: application/pdf
rss: application/rss+xml
text: text/plain
- hal:
+ hal:
- application/hal+json
- application/hal+xml
xml:
@@ -64,50 +69,6 @@ grails:
scriptlets: html
taglib: none
staticparts: none
----
-hibernate:
- cache:
- queries: false
- use_second_level_cache: true
- use_query_cache: false
- region.factory_class: 'org.hibernate.cache.ehcache.EhCacheRegionFactory'
-
-dataSource:
- pooled: true
- jmxExport: true
- driverClassName: org.h2.Driver
- username: sa
- password:
-
-environments:
- development:
- dataSource:
- dbCreate: create-drop
- url: jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
- test:
- dataSource:
- dbCreate: update
- url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
- production:
- dataSource:
- dbCreate: update
- url: jdbc:h2:prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
- properties:
- jmxEnabled: true
- initialSize: 5
- maxActive: 50
- minIdle: 5
- maxIdle: 25
- maxWait: 10000
- maxAge: 600000
- timeBetweenEvictionRunsMillis: 5000
- minEvictableIdleTimeMillis: 60000
- validationQuery: SELECT 1
- validationQueryTimeout: 3
- validationInterval: 15000
- testOnBorrow: true
- testWhileIdle: true
- testOnReturn: false
- jdbcInterceptors: ConnectionState
- defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED
-
+endpoints:
+ jmx:
+ unique-names: true
diff --git a/grails-app/conf/logback.groovy b/grails-app/conf/logback.groovy
index 664238d..2f7c41c 100644
--- a/grails-app/conf/logback.groovy
+++ b/grails-app/conf/logback.groovy
@@ -1,8 +1,6 @@
-import grails.plugins.airbrake.AirbrakeAppender
import grails.util.BuildSettings
import grails.util.Environment
-
// See http://logback.qos.ch/manual/groovy.html for details on configuration
appender('STDOUT', ConsoleAppender) {
encoder(PatternLayoutEncoder) {
@@ -10,23 +8,16 @@ appender('STDOUT', ConsoleAppender) {
}
}
-//appender("AIRBRAKE", AirbrakeAppender)
-
root(ERROR, ['STDOUT'])
-
-if(Environment.current == Environment.DEVELOPMENT) {
- def targetDir = BuildSettings.TARGET_DIR
- if(targetDir) {
-
- appender("FULL_STACKTRACE", FileAppender) {
-
- file = "${targetDir}/stacktrace.log"
- append = true
- encoder(PatternLayoutEncoder) {
- pattern = "%level %logger - %msg%n"
- }
+def targetDir = BuildSettings.TARGET_DIR
+if (Environment.isDevelopmentMode() && targetDir) {
+ appender("FULL_STACKTRACE", FileAppender) {
+ file = "${targetDir}/stacktrace.log"
+ append = true
+ encoder(PatternLayoutEncoder) {
+ pattern = "%level %logger - %msg%n"
}
- logger("StackTrace", ERROR, ['FULL_STACKTRACE'], false )
}
+ logger("StackTrace", ERROR, ['FULL_STACKTRACE'], false)
}
diff --git a/grails-app/controllers/grails/plugins/airbrake/TestController.groovy b/grails-app/controllers/grails/plugins/airbrake/TestController.groovy
new file mode 100644
index 0000000..6988035
--- /dev/null
+++ b/grails-app/controllers/grails/plugins/airbrake/TestController.groovy
@@ -0,0 +1,16 @@
+package grails.plugins.airbrake
+
+class TestController {
+
+ AirbrakeService airbrakeService
+
+ def testAirbrake() {
+
+ try {
+ throw new Exception("This is a test error")
+ } catch (Exception e) {
+ airbrakeService.notify(e, [errorMessage: e.getMessage()])
+ }
+ response.flushBuffer()
+ }
+}
diff --git a/grails-app/controllers/grails/plugins/airbrake/UrlMappings.groovy b/grails-app/controllers/grails/plugins/airbrake/UrlMappings.groovy
new file mode 100644
index 0000000..2684cd9
--- /dev/null
+++ b/grails-app/controllers/grails/plugins/airbrake/UrlMappings.groovy
@@ -0,0 +1,16 @@
+package grails.plugins.airbrake
+
+class UrlMappings {
+
+ static mappings = {
+ "/$controller/$action?/$id?(.$format)?"{
+ constraints {
+ // apply constraints here
+ }
+ }
+
+ "/"(view:"/index")
+ "500"(view:'/error')
+ "404"(view:'/notFound')
+ }
+}
diff --git a/grails-app/grails-app.iml b/grails-app/grails-app.iml
new file mode 100644
index 0000000..fe20732
--- /dev/null
+++ b/grails-app/grails-app.iml
@@ -0,0 +1,14 @@
+
+