Hi
can any java guru tell me how get the method starting line number of currently executing method? For example in class A there may be a method
void aa(int c, int d) // line number , say 512
{
// some code
}
I need to get this 512 during execution of this aa.
try to use log4j with
try to use log4j with pattern %L pattern
It will log the line number
This is simple
This is simple example
public static int getLineNumber() {
return Thread.currentThread().getStackTrace()[2].getLineNumber();
}
It will log the line
It will log the line number
try to use log4j with pattern %L pattern
try to use log4j with pattern %L pattern, it will log the line number.
Post new comment