views:

89

answers:

1

Hello, I'm creating my first grails plugin and I don't know where the logging should be configured.
In a normal grails app, there is a conf/Config.groovy file for that, but for a plugin there is none.
Is there another way to achieve this ?
I would like to see debug messages when I launch my plugin unit and integration tests...

Thanks in advance.
Philippe

+2  A: 

The create-plugin script doesn't create a Config.groovy but if you create one yourself it will be used. Don't copy one from an existing app since it'll be cluttered with stuff that isn't applicable, just create a log4j closure and whatever other properties you need:

log4j = {
    error  'org.codehaus.groovy.grails.web.servlet',  //  controllers
           'org.codehaus.groovy.grails.web.pages', //  GSP
           'org.codehaus.groovy.grails.web.sitemesh', //  layouts
           'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
           'org.codehaus.groovy.grails.web.mapping', // URL mapping
           'org.codehaus.groovy.grails.commons', // core / classloading
           'org.codehaus.groovy.grails.plugins', // plugins
           'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
           'org.springframework',
           'org.hibernate',
           'net.sf.ehcache.hibernate'

    warn   'org.mortbay.log'
}

myplugin.someproperty = 'foo'
Burt Beckwith
It's THAT simple !Thanks ;-)
Philippe