Logging on NestJS like a Pro with Correlation IDs, Log Aggregation, Winston, Morgan and more

Implementing a full production-ready Logger System for NestJS Microservices or Monolithic Apps in a Clean Architecture.

Jose Luis Navarro
13 min readNov 4, 2023
Implementing a full production-ready Logger system for NestJS Microservices or Monolithic Apps in a Clean Architecture.

In that article, I will share only the most important parts of the implementation. The complete code is published in a public Github Repository. PRs and a Star if that is helpful for you are welcome!

Logging is, probably, the most important aspect of Software Observability.

It’s the manner that our code has to talk with us. By logs, our code tells us if There have been errors during this night, if a group of operations is starting to take too much time, or how many requests we had served during the last Black Friday.

Implementing a Logger system on a basic project is very easy, we just need to fill our code with some console.log(), System.out.println() or println(), but when we are on advanced and distributed systems like Microservices or Enterprise

--

--

Jose Luis Navarro

A mere backend developer from Spain. Addicted to Node.js, PHP and K8s ecosystem..