wood burning stoves*
The moose likes Groovy and the fly likes log property in util class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "log property in util class" Watch "log property in util class" New topic

log property in util class

Paras Jain
Ranch Hand

Joined: Feb 26, 2005
Posts: 137
I have a util class under src/groovy directory. I am not getting the automatically injected log property here. What is the best way to get that property in java or groovy classes.

I have tried Logger.getRootLogger() but it returns null. Any ideas?


Paras Jain
SCJP 5.0
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299

You should just do Logger.getLogger(getClass());

GenRocket - Experts at Building Test Data
I agree. Here's the link: http://aspose.com/file-tools
subject: log property in util class
Similar Threads
Groovy Versus Java for the authors of Groovy in Action
Call groovy program from Java
Question on the Groovy book
static block
Problem With cactus testing