Permalink
Browse files

reconfigured logging for production environment: use $catalina_base/logs

  • Loading branch information...
sarmbruster committed Aug 18, 2011
1 parent 278379e commit 0e958df6b299ea9106f557a57d3f2d6a35005f73
Showing with 14 additions and 0 deletions.
  1. +14 −0 grails-app/conf/Config.groovy
@@ -70,6 +70,9 @@ environments {
}
+def catalinaBase = System.properties.getProperty('catalina.base') ?: '.'
+def logDirectory = "${catalinaBase}/logs"
+
// log4j configuration
log4j = {
// Example of changing the log pattern for the default console
@@ -93,3 +96,14 @@ log4j = {
warn 'org.mortbay.log'
}
+
+environments {
+ production {
+ log4j = {root ->
+ appenders {
+ rollingFile name: 'stdout', file: "${logDirectory}/${appName}.log".toString(), maxFileSize: '10MB', maxBackupIndex: 5
+ rollingFile name: 'stacktrace', file: "${logDirectory}/${appName}_stack.log".toString(), maxFileSize: '10MB', maxBackupIndex: 5
+ }
+ }
+ }
+}

0 comments on commit 0e958df

Please sign in to comment.