Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to make log4j print out class name and line number

 
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: 42968
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