The Benefits of Logging

Logging can be used to debug an application and determine the root cause of a failure, or to track program and user activity, and to provide a journal of the work being performed with a program for security reasons.

While there are not many who suggest that logging is unnecessary, there are those who argue there are better techniques for debugging than producing excessive log output. There is also the question of when to turn on debugging log output and what is involved in doing that. In its most primitive form, a series of output statements can be written into a Java application to debug the program, as shown below. Removing debugging would then require that all modules with the output statements would need to be removed—a ...

Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.