From the course: Google Cloud Platform Essential Training for Developers: Cloud-Native Development with Gemini

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Actionable logging with Cloud Logging and structured logs

Actionable logging with Cloud Logging and structured logs

So sadly, your app has just crashed in production, users are complaining, so what do you do? This is where monitoring helps you out. In this chapter, we're going to learn how to trace a request across services, set up alerts so that you know about problems before your boss does, and use Cloud Logging to find and fix bugs fast. Let's look at the logs. All right, so now we're going to talk about actionable logging with Cloud Logging, And we're going to do that by setting up structured logging. So in this demo, we're going to move from simple text messages to structured JSON by logging a JSON object with specific keys like latency and status. And we're going to turn our logs into a queryable database. And this is just ultimately going to allow us to use the command line interface, not just to read the text, but to filter and extract metrics instantly. So it's going to be a lot faster. Okay, so now we're going to do a more real world scenario with structured logging. And let's say you…

Contents