Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Logging in grails for specific controller

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?

like image 724
jjczopek Avatar asked May 08 '11 17:05

jjczopek


1 Answers

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.

like image 122
Dana Avatar answered Sep 24 '22 22:09

Dana