Logging for Fun: Things You’d Never Thought to Log
Editorial Note: I originally wrote this post for the LogEntries blog.
I work as a consultant in the software industry. This work affords me the opportunity to see and interact with many different teams and thus to observe prevailing trends. Among these teams, the attitude toward logging tends to be one of resigned diligence.
That is, many developers view application logging the way they view flossing their teeth: a necessary, dull maintenance activity that will pay dividends later. Today, however, I’d like to encourage readers to consider a different side of logging. In the right context and with the right intent, the activity can do so much more than simply insulate against audits and facilitate troubleshooting. Logging can, in a sense, offer similar appeal to journaling or generally recording information for posterity.
Logging loosely consists of two components: recording and storing information. As application developers, we find our thoughts occupied by the recording and how that affects our code. We consider the storage and retrieval only inasmuch as it later aids our debugging efforts. But we can expand the storage to include sophisticated aggregation, filtering, and querying techniques. And in these techniques, we can find new ways to understand subjects that interest us.
To be a bit more concrete, I’m going to offer some examples in this post of worlds that you can open through logging. But the examples will require you to view logging not as dumping data to some file, but as recording information in a way that you can mine it for meaning. Obviously not all of us share the same interests. But these examples may give you ideas for your own interests, even if they do not all appeal to you directly.