Advertisement
Guest User

Untitled

a guest
Sep 1st, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. def auditDbHost = "isfront-db.test.1mbank.int"
  2.  
  3. ibank.audit = true
  4. println "Audit logging is ${ibank.audit ? 'enabled': 'disabled'}."
  5.  
  6. def connectionSource
  7.  
  8. if (ibank.audit) {
  9. println "Audit logging will use db format."
  10. audit.dataSource = new org.apache.commons.dbcp.BasicDataSource(
  11. driverClassName: "org.postgresql.Driver",
  12. username : "isfront_audit",
  13. password : "secureaudit",
  14. url : "jdbc:postgresql://${auditDbHost}:5432/isfront",
  15. initialSize : 15,
  16. maxActive : 100,
  17. maxIdle : 5,
  18. maxWait : 15000,
  19. testOnBorrow : true,
  20. testOnReturn : true,
  21. validationQuery : "SELECT 1"
  22. )
  23. connectionSource = new org.apache.log4j.db.DataSourceConnectionSource(dataSource: audit.dataSource, overriddenSupportsGetGeneratedKeys: false)
  24. connectionSource.activateOptions()
  25. }
  26.  
  27. log4j = {
  28. if (ibank.audit) {
  29. appenders {
  30. appender new ru.infosysco.log4j.DBAppender(name: 'audit', connectionSource: connectionSource)
  31. appender new org.apache.log4j.rolling.RollingFileAppender(name: "file", layout: pattern('%d{ISO8601} [%-5p] %-20.20t %c{2} - %m%n'),
  32. rollingPolicy: new org.apache.log4j.rolling.TimeBasedRollingPolicy(
  33. fileNamePattern: '/var/log/jetty8/logs/isfront-web.test.1mbank.int-webapp.%d{yyyy-MM-dd}.log.gz'))
  34. }
  35. info audit: 'grails.app.service.ru.infosysco.ibank.service.AuditService', additivity: false
  36. } else {
  37. appenders {
  38. 'null' name: 'stacktrace'
  39. appender new org.apache.log4j.rolling.RollingFileAppender(name: "file", layout: pattern('%d{ISO8601} [%-5p] %-20.20t %c{2} - %m%n'),
  40. rollingPolicy: new org.apache.log4j.rolling.TimeBasedRollingPolicy(
  41. fileNamePattern: '/var/log/jetty8/logs/isfront-web.test.1mbank.int-webapp.%d{yyyy-MM-dd}.log.gz'))
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement