Log4J - Speed of resolving class/method/line references
Posted
by Jeach
on Stack Overflow
See other posts from Stack Overflow
or by Jeach
Published on 2009-04-07T18:50:34Z
Indexed on
2010/03/14
20:05 UTC
Read the original article
Hit count: 169
Does log4J still gather the class, method and line numbers by generating exceptions and inspecting the stack trace?
Or has Java been optimized since Sun included their own logging framework.
If not, why has there not been any optimizations made since. What is the main challenges in obtaining class, method and line numbers quickly and efficiently?
Although I hate annotations and try to avoid them, has log4J not made use of this, such as:
@log4j-class MyClass
@log4j-method currentMethodOne
At least this would avoid some companies bad habit of repeatedly writing/copying the method name as the first part of their logging message (which is seriously annoying).
Thanks,
Jeach!
© Stack Overflow or respective owner