diff --git a/examples/audit-test-allow-update-outside-transaction/build.gradle b/examples/audit-test-allow-update-outside-transaction/build.gradle index 99825c61..d6b9ffe8 100644 --- a/examples/audit-test-allow-update-outside-transaction/build.gradle +++ b/examples/audit-test-allow-update-outside-transaction/build.gradle @@ -47,36 +47,37 @@ configurations { } dependencies { - developmentOnly("org.springframework.boot:spring-boot-devtools") - compileOnly "org.springframework.boot:spring-boot-starter-logging" - compileOnly "org.springframework.boot:spring-boot-autoconfigure" - compileOnly "org.grails:grails-core" - compileOnly "org.springframework.boot:spring-boot-starter-actuator" - compileOnly "org.springframework.boot:spring-boot-starter-tomcat" - compileOnly "org.grails:grails-web-boot" - compileOnly "org.grails:grails-logging" - compileOnly "org.grails:grails-plugin-rest" - compileOnly "org.grails:grails-plugin-databinding" - compileOnly "org.grails:grails-plugin-i18n" - compileOnly "org.grails:grails-plugin-services" - compileOnly "org.grails:grails-plugin-url-mappings" - compileOnly "org.grails:grails-plugin-interceptors" - compileOnly "org.grails.plugins:cache" - compileOnly "org.grails.plugins:async" - compileOnly "org.grails.plugins:scaffolding" - compileOnly "org.grails.plugins:events" - compileOnly "org.grails.plugins:hibernate5" - compileOnly "org.grails.plugins:gsp" - implementation project(":audit-logging") - implementation "org.apache.groovy:groovy" + developmentOnly "org.springframework.boot:spring-boot-devtools" + implementation "org.grails:grails-core" + implementation "org.grails:grails-logging" + implementation "org.grails:grails-plugin-databinding" + implementation "org.grails:grails-plugin-i18n" + implementation "org.grails:grails-plugin-interceptors" + implementation "org.grails:grails-plugin-rest" + implementation "org.grails:grails-plugin-services" + implementation "org.grails:grails-plugin-url-mappings" + implementation "org.grails:grails-web-boot" + implementation "org.grails.plugins:gsp" + implementation "org.grails.plugins:hibernate5" + implementation "org.grails.plugins:scaffolding" + implementation "org.springframework.boot:spring-boot-autoconfigure" + implementation "org.springframework.boot:spring-boot-starter" + implementation "org.springframework.boot:spring-boot-starter-actuator" + implementation "org.springframework.boot:spring-boot-starter-logging" + implementation "org.springframework.boot:spring-boot-starter-tomcat" + implementation "org.springframework.boot:spring-boot-starter-validation" console "org.grails:grails-console" - profile "org.grails.profiles:web" + runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails" runtimeOnly "com.h2database:h2" runtimeOnly "org.apache.tomcat:tomcat-jdbc" - runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails" - testCompileOnly "org.grails:grails-gorm-testing-support" - testCompileOnly "org.mockito:mockito-core" + runtimeOnly "org.fusesource.jansi:jansi" + integrationTestImplementation testFixtures("org.grails.plugins:geb") + testImplementation "org.grails:grails-gorm-testing-support" testImplementation "org.grails:grails-web-testing-support" + testImplementation "org.spockframework:spock-core" + + implementation project(":audit-logging") + profile "org.grails.profiles:web" } task wrapper(type: Wrapper) { diff --git a/examples/audit-test-allow-update-outside-transaction/grails-app/conf/application.yml b/examples/audit-test-allow-update-outside-transaction/grails-app/conf/application.yml index 2ffc5f44..1e8fcdac 100644 --- a/examples/audit-test-allow-update-outside-transaction/grails-app/conf/application.yml +++ b/examples/audit-test-allow-update-outside-transaction/grails-app/conf/application.yml @@ -83,19 +83,19 @@ environments: development: dataSource: dbCreate: "create-drop" - url: "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" + url: "jdbc:h2:mem:devDb;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" + url: "jdbc:h2:mem:testDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" dataSources: second: dbCreate: "update" - url: "jdbc:h2:mem:testDb2;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" + url: "jdbc:h2:mem:testDb2;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" + url: "jdbc:h2:prodDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" properties: maxActive: -1 minEvictableIdleTimeMillis: 1800000 @@ -109,4 +109,4 @@ environments: dataSources: second: dbCreate: "update" - url: "jdbc:h2:mem:testDb2;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" + url: "jdbc:h2:mem:testDb2;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" diff --git a/examples/audit-test-allow-update-outside-transaction/grails-app/conf/logback-spring.xml b/examples/audit-test-allow-update-outside-transaction/grails-app/conf/logback-spring.xml new file mode 100644 index 00000000..3b41fb9f --- /dev/null +++ b/examples/audit-test-allow-update-outside-transaction/grails-app/conf/logback-spring.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/audit-test-allow-update-outside-transaction/grails-app/conf/logback.groovy b/examples/audit-test-allow-update-outside-transaction/grails-app/conf/logback.groovy deleted file mode 100644 index f3c7b990..00000000 --- a/examples/audit-test-allow-update-outside-transaction/grails-app/conf/logback.groovy +++ /dev/null @@ -1,32 +0,0 @@ -import ch.qos.logback.classic.encoder.PatternLayoutEncoder -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) { - pattern = "%level %logger - %msg%n" - } -} - -logger("grails.plugins.orm.auditable", DEBUG) -logger("test", DEBUG) - -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" - } - } - logger("StackTrace", ERROR, ['FULL_STACKTRACE'], false ) - } -} diff --git a/examples/audit-test/build.gradle b/examples/audit-test/build.gradle index 578de005..e90b284d 100644 --- a/examples/audit-test/build.gradle +++ b/examples/audit-test/build.gradle @@ -47,35 +47,36 @@ configurations { dependencies { developmentOnly "org.springframework.boot:spring-boot-devtools" - compileOnly "org.springframework.boot:spring-boot-starter-logging" - compileOnly "org.springframework.boot:spring-boot-autoconfigure" - compileOnly "org.springframework.boot:spring-boot-starter-actuator" - compileOnly "org.springframework.boot:spring-boot-starter-tomcat" - compileOnly "org.grails:grails-web-boot" - compileOnly "org.grails:grails-logging" - compileOnly "org.grails:grails-plugin-rest" - compileOnly "org.grails:grails-plugin-databinding" - compileOnly "org.grails:grails-plugin-i18n" - compileOnly "org.grails:grails-plugin-services" - compileOnly "org.grails:grails-plugin-url-mappings" - compileOnly "org.grails:grails-plugin-interceptors" - compileOnly "org.grails.plugins:cache" - compileOnly "org.grails.plugins:async" - compileOnly "org.grails.plugins:scaffolding" - compileOnly "org.grails.plugins:events" - compileOnly "org.grails.plugins:gsp" implementation "org.grails:grails-core" - implementation project(":audit-logging") - implementation "org.apache.groovy:groovy" + implementation "org.grails:grails-logging" + implementation "org.grails:grails-plugin-databinding" + implementation "org.grails:grails-plugin-i18n" + implementation "org.grails:grails-plugin-interceptors" + implementation "org.grails:grails-plugin-rest" + implementation "org.grails:grails-plugin-services" + implementation "org.grails:grails-plugin-url-mappings" + implementation "org.grails:grails-web-boot" + implementation "org.grails.plugins:gsp" implementation "org.grails.plugins:hibernate5" + implementation "org.grails.plugins:scaffolding" + implementation "org.springframework.boot:spring-boot-autoconfigure" + implementation "org.springframework.boot:spring-boot-starter" + implementation "org.springframework.boot:spring-boot-starter-actuator" + implementation "org.springframework.boot:spring-boot-starter-logging" + implementation "org.springframework.boot:spring-boot-starter-tomcat" + implementation "org.springframework.boot:spring-boot-starter-validation" console "org.grails:grails-console" - profile "org.grails.profiles:web" + runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails" runtimeOnly "com.h2database:h2" runtimeOnly "org.apache.tomcat:tomcat-jdbc" - runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails" + runtimeOnly "org.fusesource.jansi:jansi" + integrationTestImplementation testFixtures("org.grails.plugins:geb") testImplementation "org.grails:grails-gorm-testing-support" testImplementation "org.grails:grails-web-testing-support" - testCompileOnly "org.mockito:mockito-core" + testImplementation "org.spockframework:spock-core" + + implementation project(":audit-logging") + profile "org.grails.profiles:web" } task wrapper(type: Wrapper) { diff --git a/examples/audit-test/grails-app/conf/application.yml b/examples/audit-test/grails-app/conf/application.yml index 9edbe6f6..4977386b 100644 --- a/examples/audit-test/grails-app/conf/application.yml +++ b/examples/audit-test/grails-app/conf/application.yml @@ -82,24 +82,24 @@ environments: development: dataSource: dbCreate: "create-drop" - url: "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" + url: "jdbc:h2:mem:devDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" dataSources: second: dbCreate: "update" - url: "jdbc:h2:mem:testDb2;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" + url: "jdbc:h2:mem:testDb2;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" test: #we test with several configured datasources. See GPAUDITLOGGING-64 dataSource: dbCreate: "update" - url: "jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" + url: "jdbc:h2:mem:testDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" dataSources: second: dbCreate: "update" - url: "jdbc:h2:mem:testDb2;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" + url: "jdbc:h2:mem:testDb2;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" + url: "jdbc:h2:prodDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" properties: maxActive: -1 minEvictableIdleTimeMillis: 1800000 @@ -113,4 +113,4 @@ environments: dataSources: second: dbCreate: "update" - url: "jdbc:h2:mem:testDb2;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" + url: "jdbc:h2:mem:testDb2;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" diff --git a/examples/audit-test/grails-app/conf/logback-spring.xml b/examples/audit-test/grails-app/conf/logback-spring.xml new file mode 100644 index 00000000..3b41fb9f --- /dev/null +++ b/examples/audit-test/grails-app/conf/logback-spring.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/audit-test/grails-app/conf/logback.groovy b/examples/audit-test/grails-app/conf/logback.groovy deleted file mode 100644 index 50270c55..00000000 --- a/examples/audit-test/grails-app/conf/logback.groovy +++ /dev/null @@ -1,32 +0,0 @@ -import ch.qos.logback.classic.encoder.PatternLayoutEncoder -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) { - pattern = "%level %logger - %msg%n" - } -} - -logger("grails.plugins.orm.auditable", TRACE) -logger("test", DEBUG) - -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" - } - } - logger("StackTrace", ERROR, ['FULL_STACKTRACE'], false ) - } -} diff --git a/examples/audit-test/grails-app/domain/test/Tunnel.groovy b/examples/audit-test/grails-app/domain/test/Tunnel.groovy index 8bf82af0..9fa75338 100644 --- a/examples/audit-test/grails-app/domain/test/Tunnel.groovy +++ b/examples/audit-test/grails-app/domain/test/Tunnel.groovy @@ -7,6 +7,6 @@ class Tunnel implements Auditable { String description static constraints = { - description maxSize:1073741824, nullable:true + description maxSize:1000000000, nullable:true } } diff --git a/plugin/grails-app/conf/application.yml b/plugin/grails-app/conf/application.yml index 747b251b..a4e4002c 100644 --- a/plugin/grails-app/conf/application.yml +++ b/plugin/grails-app/conf/application.yml @@ -80,15 +80,15 @@ environments: development: dataSource: dbCreate: create-drop - url: jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE + url: jdbc:h2:mem:devDb;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 + url: jdbc:h2:mem:testDb;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 + url: jdbc:h2:prodDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE properties: jmxEnabled: true initialSize: 5