dcsimg
how do I include the method name in log4j?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   tezcan_dilshener
Posted On:   Monday, July 21, 2003 04:35 AM

Hi all,


could someone please tell me

how I could get the method name to be printed in the logfiles.


Here is my layout tag from the config file








All I need is the key for the method name in the value attribute.


Thanks

Re: how do I include the method name in log4j?

Posted By:   Christopher_Koenigsberg  
Posted On:   Monday, July 21, 2003 06:38 AM

By convention in each method I usually have 'final String mylogname = "mymethodname";'


And then by convention I do 'logger.debug(mylogname + " the log message ");' .... also by convention I get a Logger called logger, for each class, under the name of the class.

About | Sitemap | Contact