阅读背景:

如何使用Java在日志文件中编写调用方位置信息,而不影响性能?

来源:互联网 

How can I write caller location information (Java source file and line), in a log file using Java and log4j, but without hurting performance? log4j allow you to write such information in the log file, but it uses the stack trace to get that it information, every time a log statement is issued, what causes performance degradation. I'm looking for a performance friendly alternative, like getting the location information at compile time instead at runtime. It is possible to use annotations to accomplish that? Or maybe some other technique?How can I write caller location information (Ja




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: