grails spring webflow -- log4j configuration not working within the flow closure

84 views Asked by At

I have a very simple demo for grails spring webflow plugin:

class MyController {

def index() {
    log.debug(">>>>>>>>>>>>>>>>>>>>It works in a method")
    test()
}

def test = {
    log.debug(">>>>>>>>>>>>>>>>>>>It works in a closure")
}
def someFlow = {
    start{
        action{

            log.debug("It doesn't work!!")

            return Success()    
        }
        on("Success").to "success"
        on("Failure").to "failure"
    }


    success{

    }

    failure{

    }
}

}

i updated the logger level of this controller to "debug":

log4j.main = {
// Example of changing the log pattern for the default console appender:
//
//appenders {
//    console name:'stdout', layout:pattern(conversionPattern: '%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.orm.hibernate',      // hibernate integration
       'org.springframework',
       'org.hibernate',
       'net.sf.ehcache.hibernate'

debug 'grails.app.controllers.MyController',
      'org.codehaus.groovy.grails.plugins'

}

Now it works fine within "index" method and "test" closure, but the one inside the flow closure doesn't work.

It seems the logger level setting doesn't affect the flow closure.

Where am i doing wrong?

1

There are 1 answers

0
BruceDu On BEST ANSWER
    debug 'org.codehaus.groovy.grails.webflow'