Thursday, March 7, 2013

Log4j Default Settings

In Grails I find this the best log4j settings to use in my Config.groovy

log4j = {
    debug 'grails.app' 

    appenders {
      console name:'stdout', follow:true, layout:pattern(conversionPattern: '%d{HH:mm:ss} | [%-5p] | %c{2} | %m%n')
      //rollingFile name:'mylog', file:'logs/eComm.log', maxFileSize:'10000KB',  maxBackupIndex:10, layout:pattern(conversionPattern: '%d{dd-MMM-yyyy HH:mm:ss} | [%-5p] | %c{2} | %m%n') 
    }


    error  'org.codehaus.groovy.grails.web.servlet',  //  controllers
         'org.codehaus.groovy.grails.web.pages', //  GSP
         'org.codehaus.groovy.grails.web.sitemesh', //  layouts
         'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
         'org.codehaus.groovy.grails.web.mapping', // URL mapping
         'org.codehaus.groovy.grails.commons', // core / classloading
         'org.codehaus.groovy.grails.plugins', // plugins
         'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
         'org.springframework',
         'org.hibernate',
         'grails.app.services.org.grails.plugin.resource',
         'grails.app.taglib.org.grails.plugin.resource',
         'grails.app.resourceMappers.org.grails.plugin.resource',
         'net.sf.ehcache.hibernate'

    warn   'org.mortbay.log'     
}

No comments:

Post a Comment