Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to make log4j print out class name and line number  RSS feed

 
Tien Duong Nguyen
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's possible. The PatternLayout javadocs have all the details.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!