File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Groovy and the fly likes log property in util class Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Other Languages » Groovy
Reply 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: 137
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
Sheriff

Joined: Jul 11, 2001
Posts: 15040

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


My Blog | DZone Articles
 
jQuery in Action, 2nd edition
 
subject: log property in util class
 
Threads others viewed
Groovy Versus Java for the authors of Groovy in Action
Question on the Groovy book
Problem With cactus testing
Call groovy program from Java
static block
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com