开发者

Are "slow" logback pattern options that slow?

I see the following in the logback documentation:

http://logback.qos.ch/manual/layouts.html#line

Generating the line number information is not particularly fast. Thus, its use s开发者_JAVA技巧hould be avoided unless execution speed is not an issue.

There are similar warnings for the method name, calling class, etc.

It would be very helpful to get line number and method information in our logs when trying to diagnose issues. So...

Is this really an issue for database CRUD apps?

I understand this likely uses reflection but it's my understanding that in more modern JVM's (we're using 1.6) there really isn't that much of a performance hit for reflection calls?

Is this going to be even remotely noticeable when compared against our DB calls?

Thanks in advance for the help guys.


The concern isn't so much reflection, its getting a stack trace.
The information you discuss (line number, calling method, etc.) is available from a stack trace, not via reflection.
Generating a stack trace on the fly can be expensive.
Of course, the only REAL way to be sure it's not an issue for your application is to measure or profile the application with such calls and without such calls.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜