People keep coming up to me at Christmas parties and asking me what I log in my applications.
And I tell them:
- All unhandled exceptions, via an Application-wide exception handler
- Performance data for certain critical areas of the app
- In certain areas of the application, we suspect aren’t being used much
- At application start-up so we can see how often the app is being used
And in development – debug statements can be used to “print” the state of objects – often saves getting slowed down by the debugger.
You could also add log statements for code paths you suspect are not being used in Production.
Now I can just tell these partygoers to subscribe to my RSS feed, and get back to enjoying another snowball, or a glass of Baileys.