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
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Reply 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
Marshal

Joined: Mar 22, 2005
Posts: 32769
That's possible. The PatternLayout javadocs have all the details.


Android appsImageJ pluginsJava web charts
 
 
subject: how to make log4j print out class name and line number
 
Threads others viewed
Determine from which main class the call came from to a method
Runtime method names
dinamic variables value in log4j
Using log4j with iPlanet
Log4J help
IntelliJ Java IDE