development {
log4j {
appender.access="org.apache.log4j.ConsoleAppender"
appender.'access.layout'="org.apache.log4j.PatternLayout"
appender.access.layout.ConversionPattern==%d %p %x [%c] %m%n //you must put the quote around "access.layout.ConversionPattern"
logger
{
grails.'app.controller.UserController'='warn,access'
}
}
}
following statement is copy from Grails official site,it explain why we should do it like that
A couple things to keep in mind while modifying Config.groovy:
1) Unlike the flat format used by log4j, the Grails config format is hierarchical, so if you write:
grails.app.controller.YourController="debug,stdout"
grails="info,stdout"
grails.'app.controller.YourController'="debug,stdout"
grails="info,stdout"
grails.app="info,stdout"
grails.app.controller="debug,stdout"
Reversing the lines will eliminate the error (but the definition of grails.app will override the definition of grails.app.controller):
grails.app.controller="debug,stdout"
grails.app="info,stdout"
But After I fix it,it sitll can not doesn't work.then I google again and again.finally,
I found there are something error in default generate from Grails.
we should change following line
logger
{
grails.'app.controller.UserController'='warn,access'
}
logger.
logger.grails.'app.controller.UserController'='warn,access'
now it's work well done.
No comments:
Post a Comment