Skip to main content

Ben Cromwell

Tag: Dev-Philosophy

Logging

Logging is an important thing to get right. It is a window into what’s happening in your application, right now and [x] days ago. Keeping a close eye on the error logs allows you to find bugs that users haven’t reported, or haven’t noticed. Doing logging right involves a few different strategies in conjunction with each other.

# UTC All The Things (TM)

Your server and application are both running UTC, right? Otherwise, you’re gonna have a hard time (or a harder time, depending on your timezone) marrying up log messages from syslog, your webserver and your application. Sometimes you need to locate the HTTP request in the Apache access logs that resulted in a particular application-side error log message. It’s easy to forget during BST that the time you’re grepping the logs for is offset by an hour! When you’re investigating an isssue on production the last thing yo want to do is increase your cognitive load by remembering which set of logs you need to subtract an hour from. Worse if you’re in a +3h45m timezone.