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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access