Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

log property in util class

 
Paras Jain
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should just do Logger.getLogger(getClass());
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic