O'Reilly logo

Apache Jakarta and Beyond: A Java Programmer’s Introduction by Larne Pekowsky

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. Logging

There are many times where it is useful or even necessary to peer inside a program and observe what it is doing. The most complete way to do this is with a debugger, such as the one included in Eclipse. This is not always a possible or practical solution for many reasons, not the least of which is that there is no way to run a production system in a debugger. Therefore, it must become the program’s task to report on its internal state. In the most general sense this task is called logging.

An obvious and much-used technique to log information is to liberally sprinkle println() statements throughout a program. However, this approach quickly proves to be insufficient for many reasons.

Printing all log messages ignores the fact ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required