Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def auditDbHost = "isfront-db.test.1mbank.int"
- ibank.audit = true
- println "Audit logging is ${ibank.audit ? 'enabled': 'disabled'}."
- def connectionSource
- if (ibank.audit) {
- println "Audit logging will use db format."
- audit.dataSource = new org.apache.commons.dbcp.BasicDataSource(
- driverClassName: "org.postgresql.Driver",
- username : "isfront_audit",
- password : "secureaudit",
- url : "jdbc:postgresql://${auditDbHost}:5432/isfront",
- initialSize : 15,
- maxActive : 100,
- maxIdle : 5,
- maxWait : 15000,
- testOnBorrow : true,
- testOnReturn : true,
- validationQuery : "SELECT 1"
- )
- connectionSource = new org.apache.log4j.db.DataSourceConnectionSource(dataSource: audit.dataSource, overriddenSupportsGetGeneratedKeys: false)
- connectionSource.activateOptions()
- }
- log4j = {
- if (ibank.audit) {
- appenders {
- appender new ru.infosysco.log4j.DBAppender(name: 'audit', connectionSource: connectionSource)
- appender new org.apache.log4j.rolling.RollingFileAppender(name: "file", layout: pattern('%d{ISO8601} [%-5p] %-20.20t %c{2} - %m%n'),
- rollingPolicy: new org.apache.log4j.rolling.TimeBasedRollingPolicy(
- fileNamePattern: '/var/log/jetty8/logs/isfront-web.test.1mbank.int-webapp.%d{yyyy-MM-dd}.log.gz'))
- }
- info audit: 'grails.app.service.ru.infosysco.ibank.service.AuditService', additivity: false
- } else {
- appenders {
- 'null' name: 'stacktrace'
- appender new org.apache.log4j.rolling.RollingFileAppender(name: "file", layout: pattern('%d{ISO8601} [%-5p] %-20.20t %c{2} - %m%n'),
- rollingPolicy: new org.apache.log4j.rolling.TimeBasedRollingPolicy(
- fileNamePattern: '/var/log/jetty8/logs/isfront-web.test.1mbank.int-webapp.%d{yyyy-MM-dd}.log.gz'))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement