Index: trunk/grails-app/conf/Config.groovy
===================================================================
--- trunk/grails-app/conf/Config.groovy	(revision 199)
+++ trunk/grails-app/conf/Config.groovy	(revision 200)
@@ -37,17 +37,18 @@
 
 /**
- * Start of log4j configuration.
- * Causing this file to reload (e.g. edit/save) may break the appLog destination
- * and further logs will be written to files or directories like "[:]"
+ * Log4j configuration.
+ * Causing this file to reload (e.g. edit+save) may break the appLog destination
+ * and further logs will be written to files or directories like "[:]".
  * For more info see http://logging.apache.org/log4j/1.2/manual.html
  * For log levels see http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html
  * Basic log levels are ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < OFF
  */
-def logDirectory = '.'
+// Pickup the Tomcat/Catalina logDirectory else use the current dir.
+def catalinaBase = System.properties.getProperty('catalina.base')
+def logDirectory = catalinaBase ? "${catalinaBase}/logs" : '.'
 
 log4j = {
     appenders {
         // Use if we want to prevent creation of a stacktrace.log file.
-        // Beware that since we are using assingment above 'log4j =' this may override things you did not want to.
         'null' name:'stacktrace'
 
@@ -85,9 +86,23 @@
     error "grails.app" // Set the default log level for our app code.
     info "grails.app.bootstrap" // Set the log level per type and per type.class
-    debug "grails.app.service"
-    debug "grails.app.controller"
     error "grails.app.service.PersonService"
     error "grails.app.service.NavigationService"
     error "grails.app.service.com.zeddware.grails.plugins.filterpane.FilterService"
+
+    // Move anything that should behave differently into this section.
+    switch(environment) {
+        case 'development':
+            debug "grails.app.service"
+            debug "grails.app.controller"
+            break
+        case 'test':
+            debug "grails.app.service"
+            debug "grails.app.controller"
+            break
+        case 'production':
+            warn "grails.app.service"
+            warn "grails.app.controller"
+            break
+    }
 }
 
@@ -99,22 +114,4 @@
     production {
         grails.serverURL = "http://www.changeme.com" // Set serverURL stem for creating absolute links.
-        log4j {
-            appenders {
-                // Pickup the Tomcat/Catalina logDirectory else use the current dir.
-                def catalinaBase = System.properties.getProperty('catalina.base')
-                logDirectory = catalinaBase ? "${catalinaBase}/logs" : '.'
-
-                rollingFile name:"appLog",
-                                file:"${logDirectory}/${appName}.log".toString(),
-                                maxFileSize:'1MB',
-                                maxBackupIndex:0,
-                                layout:pattern(conversionPattern: '%d{[EEE, dd-MMM-yyyy @ HH:mm:ss.SSS]} [%t] %-5p %c %x - %m%n')
-
-            }
-            error "grails.app" // Set the default log level for our app code.
-            info "grails.app.bootstrap" // Set the log level per type and per type.class
-            warn "grails.app.service"
-            warn "grails.app.controller"
-        }
     }
 
