views:

24

answers:

1

I see the following in the logback documentation:

Generating the line number information is not particularly fast. Thus, its use should be avoided unless execution speed is not an issue.

There are similar warning for 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.

+1  A: 

The concern isn't so much reflection as 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.

Brian Clapper