A bearded gopher with a lightsaber cutting up some logs

Thoughts on Logging


404 Error Illustration by Pixeltrue from Ouch!

Handling errors is really important in Go. Errors are first class citizens and there are many different approaches for handling them. Initially I started off basing my error handling almost entirely on a blog post from Rob Pike and created a carve-out from his code to meet my needs. It…


Inspiration

“If you are out there, and I’m speaking to you listener, or watcher, if you are out there and thinking/meaning to muster up the energy or overcome the imposter syndrome to write a blog…


I built my first Go library! httplog provides middleware which logs http requests and responses along with a few other features I find useful. I thought it might be helpful for some. At the very least, I tried to document the library reasonably well, spending a lot of time developing…


Redis is pretty great. It is the #1 most loved database for the second year in a row, according to a recent Stack Overflow survey. I decided it was high time I taught myself how to use it with Go.

There are a number of libraries in the Go ecosystem…


I’m working through creating a RESTful API template. As part of it, I want to be able to “Containerize” my app using docker and deploy it to “the cloud”. Baby steps for me though — I want to get everything working locally first. This post is about “containerizing” my API…


I like simple structured messages using JSON in error responses, similar to Stripe, Uber and many others…

{
"error": {
"type": "validation_failed",
"message": "Username is a required field"
}
}

In my last story, I wrote about HTTP Logging and in that I mentioned that I have used “chained” middleware…

Dan Gillis

Go enthusiast; Loyalty/CRM Technology Leader; Drummer; Vinyl geek; Husband/Dad

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store