This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes how to make log4j print out class name and line number Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "how to make log4j print out class name and line number" Watch "how to make log4j print out class name and line number" New topic
Author

how to make log4j print out class name and line number

Tien Duong Nguyen
Greenhorn

Joined: Oct 22, 2004
Posts: 22
Hi everyone,

I am looking for the way to print out the class name and line number in logging message.

E.g : logger.info ("message "); -> ClassName ( line number ) : message.

Can we do it with log4j

Regards,

Andy.


SCEA (part 1), part 2,3 in progress<br /> <br />SCBCD,SCWCD,SCJP
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42956
    
  73
That's possible. The PatternLayout javadocs have all the details.
 
wood burning stoves
 
subject: how to make log4j print out class name and line number
 
It's not a secret anymore!