...

/

Log Levels and Structured Logging

Log Levels and Structured Logging

Understand the different log levels available in Go and the value structured logging adds to an app.

Logging in an app can be as simple or as complicated as we want it to be. It all depends on how the logs are going to be used. While Go's built-in library is good for basic logging, it lacks a lot of advanced features that other third-party packages can provide out of the box.

Some of them, like Zap from Uber, are blazing fast, while Logrus and Zerolog are great for structured logging. Wait, what's structured logging? We'll discuss it soon enough in this lesson.

But before we get into using any of these libraries, let's tackle the first step toward organizing and structuring logs: log levels.

Log levels

Adding logs to our code is ...