This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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


JavaRanch » Java Forums » Languages » Groovy
Bookmark "log property in util class" Watch "log property in util class" New topic
Author

log property in util class

Paras Jain
Ranch Hand

Joined: Feb 26, 2005
Posts: 138
Hi,
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?

Regards,
Paras


Paras Jain
SCJP 5.0
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302
    
    6

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


GenRocket - Experts at Building Test Data
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: log property in util class
 
It's not a secret anymore!