How can i use 'log' inside a src/groovy/ class

Posted by firnnauriel on Stack Overflow See other posts from Stack Overflow or by firnnauriel
Published on 2010-04-05T08:58:37Z Indexed on 2010/04/05 9:03 UTC
Read the original article Hit count: 264

Filed under:
|

I'm encountering this error:

groovy.lang.MissingPropertyException: No such property: log for class: org.utils.MyClass

Here's the content of the class:

package org.utils

class MyClass {
    int organizationCount = 0

    public int getOrganizationCount(){
        log.debug "There are ${organizationCount} organization(s) found."
        return organizationCount
    }

}

Do i need to add an import statement? What do i need to add? Note that the class is located in src/groovy/org/utils. I know that the 'log' variable is accessible in controllers, services, etc. Not sure in 'src' classes.

Thanks.

© Stack Overflow or respective owner

Related posts about grails

Related posts about log4j