I've been struggling with this issue some time. I found some hints via Google, especially a thread in Pubbs and one in Nabble. Both didn't help, though.
I don't know if what I did is good, or even "legal" or the Groovy way or... whatever, it works, though. Here on Grails 1.1.1 at least.
Here's the code:
It's so easy. I just instantiate a new object of the type of the current domain class and get its log property. That downsize is, it can't be copy-pasted to any domain class without editing it. Don't know if there's a solution to that.def log = (new MyDomainClass()).log
For those who want a more talkative example:
Did this help? Let me know in the comments.class MyDomainClass{
static myStaticMethod () {
def log = (new MyDomainClass()).log
log.debug "This is a log message from a static domain method"
}
}