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 controller (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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With