environments { development { log4j = { // in development mode, let's see all my log messages debug 'grails.app' } } production { def catalinaBase = System.properties.getProperty('catalina.base') if (!catalinaBase) catalinaBase = '.' // just in case def logDirectory = "${catalinaBase}/logs" log4j = { appenders { // set up a log file in the standard tomcat area; be sure to use .toString() with ${} rollingFile name:'tomcatLog', file:"${logDirectory}/${appName}.log".toString(), maxFileSize:'100KB' 'null' name:'stacktrace' } root { // change the root logger to my tomcatLog file error 'tomcatLog' additivity = true } // example for sending stacktraces to my tomcatLog file //error tomcatLog:'StackTrace' // set level for my messages; this uses the root logger (and thus the tomcatLog file) info 'grails.app' } } }