开发者

Logging in grails for specific controller

开发者 https://www.devze.com 2023-03-04 16:43 出处:网络
I have this code in my Config.groovy: appenders { console name: \"stdout\", layout: pattern(conversionPattern: \"%c{2} %m%n\")

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消