2012-09-21 39 views
1

我为log4j的的log4j Grails中

log4j = { 
    // Example of changing the log pattern for the default console appender: 
    // 
    appenders { 
     console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n') 
    } 

    info 'grails.app.controllers' 

    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', 
      'net.sf.ehcache.hibernate' 
} 

,当我在我的控制器不log.info,我没有看到任何输出下面的配置被记录到控制台无法正常工作。任何原因为什么?

+0

什么版本的Grails? grails.app.controllers对于Grails 2.x是正确的,但对于1.3.x和更早版本,它需要是'grails.app.controller'(no“s”)。 –

+0

Grails版本是2.1.1 – allthenutsandbolts

回答