Ad

How Does Debug Level (0-99) In The Tomcat Server.xml Affect Speed?

- 1 answer

The server.xml which controls the startup of Apache Tomcat's servlet container contains a debug attribute for nearly every major component. The debug attribute is more or less verbose depending upon the number you give it, zero being least and 99 being most verbose. How does the debug level affect Tomcat's speed when servicing large numbers of users? I assume zero is fast and 99 is relatively slower, but is this true. If there are no errors being thrown, does it matter?

Ad

Answer

Extensive logging takes a significant amount of time. This is why it is so important to put

if (log.isDebugEnabled())
  log.debug(bla_bla_bla);

so I would say that seting your production server to being verbose would seriously affect performance. I assume it's a production server you're talking about since you say it must service a large number of users.

Ad
source: stackoverflow.com
Ad