Friday, January 30, 2009

Excessive Logging Sucks up Application Performance

I have seen some people performing logging operation unnessasarily.According to them,logging helps to idenify bugs quickly.But excessive use of logging can have a very serious impact on the performance of the application.I think if some errors occour,then those can be easily detected by logging the exception stacktrace.So I think,logging only stack trace info in catch section (java code) can help in improving performance a lot(most of the bugs can be traced from the error stack).Also , logging start and end of methods gives a good idea about the program flow.Apart from that logging should be avoided as much as possible because logging requires disk access which is always an expensive operation in terms of performance.