NestJs Logging Tutorial 2021
Vložit
- čas přidán 20. 07. 2021
- Logging is a very important aspect of any serious development experience. It is critical during the development phase as it helps to identify bugs.
But logging is also important during the production phase, especially when it comes to cron jobs and other asynchronous tasks. This is because you need to have an eye on what is happening on your server. If a cron job is not working properly you should be the first to know.
In this tutorial, we are going to examine how to implement the NestJS logger for your app.
You basically want to use logs at two levels: HTTP request level and service level.
Let’s dive in! 😄
Nestjs Logging Tutorial 2021
👉 Github repo of the project
github.com/vladwulf/nestjs-lo...
👉 Written version of this tutorial
javascript.plainenglish.io/ho...
I hope you loved this video! 🙂
📮Consider subscribing to my newsletter: codewithvlad.substack.com
🔥 And follow me on Twitter: twitter.com/vladimir_agaev
Dear Vlad - you are the master of NestJS here on CZcams - please, keep up your great work! Thank you!
This is the best video I found on CZcams for a NestJS custom logger.
High quality content for NestJS. I got started with NestJS through your videos. Keep up the great work mate!
Thank you Dina!
Would you consider doing a video on how to extend the default logger to include file logging as well?
Nice one, simple explanation !!!
Thanks. Easy to understand.
Helps me a lot, expecially the `response.on("finish" , () => {})` part, which solve the problem that confuses me for a long time when my response status-codes always start with 2.
What logger do you use for production? with log rotation. Pino, winston?
I really hope you get the subs and views you deserve
Good job! Any ideas about how to achieve log rotation with built-in nestjs logger ? Thanks in advance. Take care.
The built-in nestjs logger is mainly used for development. For production, I suggest using external logging tools where you can send your logs by api.
And how to log it into file?
Hey thanks for the tutorials bro, your videos are very good. I'm migrating a project from express to nest but it is very hard nothing works the same xd. Tried to make the functional logger work with winston and morgan but winston gives problems... This will do for now :).
Nvm I could do it my errors were because I was importing like this: import winston from "winston" and had to be: import * as winston from "winston".
what settings did you apply for the terminal ?, apple icon , branch name and etc.
I usually use material theme and material icons :)
thank you
Thanks
Works with graphql?
I haven't tried with graphql. I will give it a go.
я только об это подумал и тут комментарий)