I have this code in my Config.groovy:
appenders {
console name: "stdout", layout: pattern(conversionPattern: "%c{2} %m%n")
}
root {
warn 'stdout'
}
Now I want to log messages with DEBUG level from a specific co开发者_如何学JAVAntroller (or specific package). How can I achieve that?
If your controller name is ExampleController
in the com.example
package, add this to the log4j closure in your Config.groovy
:
debug 'grails.app.controllers.com.example.ExampleController'
See the Grails user guide for more logging examples.
Try this:
debug "grails.app.controller.your.package.YourController"
I'm assuming you're using grails 1.3.X. There was a difference in 1.0.X versions of grails.
精彩评论