O'Reilly logo

TypeScript Microservices by Parth Ghiya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Auditing via logs 

Until now, we have heard that microservices are distributed and services are constantly in flux. We need to keep track of all the services and the output that they throw. Using console.log() is a very bad practice as we won't be able to keep track of all the services because console.log() doesn't have a fixed format. Also, we need a stack trace whenever there is an error to debug the possible problem. To have distributed logging, we will use the winston module (https://github.com/winstonjs/winston). It has various options, such as log levels, log formats, and so on. For each microservice, we will be passing a unique microservice ID, which will identify it when we aggregate the logs. For aggregation, we will use the famous ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required