You’ve decided to step up your logging game and start sending more valuable, structured logs that you can query, aggregate, and use for debugging in production. Go, you!
Now, uh, how do you actually write them?
We’re not going to spend much time on what you should log. We’ve covered that already, a few times before.
TL;DR: collect useful debugging context as code executes, then emit wide-event logs at meaningful milestones. Always emit a final outcome event on both success and failure paths.
What we will be covering is how to actually write those logs, answering questions like:









