How to get java class name and method name and print it from the method
Meir Yan
Ranch Hand
Joined: Apr 27, 2006
Posts: 597
posted
0
Hello all Im using custom logger (simple prints) And I like to print the class name and the method from witch the log print has bean executed. How can I do it ? p.s I can't use log4j in my project .
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35224
7
posted
0
"new Exception().getStackTrace()" gives you the stack trace information which contains the class and method name.