Chapter 11. Tracing

What is tracing? Ask any two developers, and you are likely to get different answers. I'm talking about tracing that means, in a nutshell, reporting what happens inside an application while it is running, whether what happened was good or bad, happy or sad. That definition covers a lot of ground. It includes tracing (sometimes referred to as logging) meant for other developers, tracing meant for support personnel, and even error reporting meant for end users. These all involve reporting in some fashion about something that happened inside the application that you want one of those constituencies to know about. You may want them to know about it right away, or you may want to squirrel away the information for later reference. Tracing can be used to inform support personnel about steps they need to take right away, or it might be done for archival and research purposes to track the long-term behavior of a given application.

Because tracing can cover so many different situations, it's important to come up with a comprehensive way to deal with tracing as a whole so that all of the pieces are well integrated. If you use three different tracing systems to reach three different sets of users, it can become very difficult to keep track of what goes where and which system should be used when. And then it becomes hard to switch from one tracing mechanism to another or to report the same problems to different people.

Get Code Leader: Using People, Tools, and Processes to Build Successful 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.