Using Log Files to Debug an Application

At one time, there were no symbolic debuggers. You couldn't bring up the source code and step through one line at a time, printing out variable values as the program changed them. The only thing you could do was write out debugging statements to indicate what the program was doing.

Believe it or not, logging is still one of the most common ways to debug a program. Debuggers, although useful, often interfere with the debugging process in a number of ways. With other languages, such as C++, programs could behave significantly differently when running a debugger. It is not uncommon for a C++ program to run fine under a debugger and crash without the debugger.

Logging lets you display information at different ...

Get Special Edition Using Java™ 2 Enterprise Edition 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.