Changeset 200 for trunk/grails-app/conf
- Timestamp:
- Nov 29, 2009, 10:13:48 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/Config.groovy
r199 r200 37 37 38 38 /** 39 * Start of log4j configuration.40 * Causing this file to reload (e.g. edit /save) may break the appLog destination41 * and further logs will be written to files or directories like "[:]" 39 * Log4j configuration. 40 * Causing this file to reload (e.g. edit+save) may break the appLog destination 41 * and further logs will be written to files or directories like "[:]". 42 42 * For more info see http://logging.apache.org/log4j/1.2/manual.html 43 43 * For log levels see http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html 44 44 * Basic log levels are ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < OFF 45 45 */ 46 def logDirectory = '.' 46 // Pickup the Tomcat/Catalina logDirectory else use the current dir. 47 def catalinaBase = System.properties.getProperty('catalina.base') 48 def logDirectory = catalinaBase ? "${catalinaBase}/logs" : '.' 47 49 48 50 log4j = { 49 51 appenders { 50 52 // Use if we want to prevent creation of a stacktrace.log file. 51 // Beware that since we are using assingment above 'log4j =' this may override things you did not want to.52 53 'null' name:'stacktrace' 53 54 … … 85 86 error "grails.app" // Set the default log level for our app code. 86 87 info "grails.app.bootstrap" // Set the log level per type and per type.class 87 debug "grails.app.service"88 debug "grails.app.controller"89 88 error "grails.app.service.PersonService" 90 89 error "grails.app.service.NavigationService" 91 90 error "grails.app.service.com.zeddware.grails.plugins.filterpane.FilterService" 91 92 // Move anything that should behave differently into this section. 93 switch(environment) { 94 case 'development': 95 debug "grails.app.service" 96 debug "grails.app.controller" 97 break 98 case 'test': 99 debug "grails.app.service" 100 debug "grails.app.controller" 101 break 102 case 'production': 103 warn "grails.app.service" 104 warn "grails.app.controller" 105 break 106 } 92 107 } 93 108 … … 99 114 production { 100 115 grails.serverURL = "http://www.changeme.com" // Set serverURL stem for creating absolute links. 101 log4j {102 appenders {103 // Pickup the Tomcat/Catalina logDirectory else use the current dir.104 def catalinaBase = System.properties.getProperty('catalina.base')105 logDirectory = catalinaBase ? "${catalinaBase}/logs" : '.'106 107 rollingFile name:"appLog",108 file:"${logDirectory}/${appName}.log".toString(),109 maxFileSize:'1MB',110 maxBackupIndex:0,111 layout:pattern(conversionPattern: '%d{[EEE, dd-MMM-yyyy @ HH:mm:ss.SSS]} [%t] %-5p %c %x - %m%n')112 113 }114 error "grails.app" // Set the default log level for our app code.115 info "grails.app.bootstrap" // Set the log level per type and per type.class116 warn "grails.app.service"117 warn "grails.app.controller"118 }119 116 } 120 117
Note: See TracChangeset
for help on using the changeset viewer.