NestJs Logging Tutorial 2021

Sdílet
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...

Komentáře • 22

  • @CodeWithVlad
    @CodeWithVlad  Před 3 lety +4

    I hope you loved this video! 🙂
    📮Consider subscribing to my newsletter: codewithvlad.substack.com
    🔥 And follow me on Twitter: twitter.com/vladimir_agaev

  • @jaroslavhuss7813
    @jaroslavhuss7813 Před 2 lety

    Dear Vlad - you are the master of NestJS here on CZcams - please, keep up your great work! Thank you!

  • @conservativ724
    @conservativ724 Před rokem

    This is the best video I found on CZcams for a NestJS custom logger.

  • @dnafication
    @dnafication Před 2 lety

    High quality content for NestJS. I got started with NestJS through your videos. Keep up the great work mate!

  • @adayatmydesk6291
    @adayatmydesk6291 Před 2 lety +3

    Would you consider doing a video on how to extend the default logger to include file logging as well?

  • @sliceem88
    @sliceem88 Před rokem

    Nice one, simple explanation !!!

  • @ashishkumari-yg4gn
    @ashishkumari-yg4gn Před 9 měsíci

    Thanks. Easy to understand.

  • @user-eq1od1mm7m
    @user-eq1od1mm7m Před 2 lety

    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.

  • @antnzr656
    @antnzr656 Před 2 lety

    What logger do you use for production? with log rotation. Pino, winston?

  • @saybers-4516
    @saybers-4516 Před rokem

    I really hope you get the subs and views you deserve

  • @xavierrispal9605
    @xavierrispal9605 Před 2 lety

    Good job! Any ideas about how to achieve log rotation with built-in nestjs logger ? Thanks in advance. Take care.

    • @CodeWithVlad
      @CodeWithVlad  Před 2 lety +1

      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.

  • @madashindeinai4783
    @madashindeinai4783 Před 2 lety

    And how to log it into file?

  • @darkfoxwillie
    @darkfoxwillie Před 2 lety

    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".

  • @BloknotKulinara
    @BloknotKulinara Před 2 lety

    what settings did you apply for the terminal ?, apple icon , branch name and etc.

    • @CodeWithVlad
      @CodeWithVlad  Před 2 lety

      I usually use material theme and material icons :)

  • @user-xk1cf9si5h
    @user-xk1cf9si5h Před 2 lety

    thank you

  • @esrefatak
    @esrefatak Před 2 lety

    Thanks

  • @juniorpessoa4030
    @juniorpessoa4030 Před 3 lety +1

    Works with graphql?

    • @CodeWithVlad
      @CodeWithVlad  Před 3 lety +1

      I haven't tried with graphql. I will give it a go.

    • @N5O1
      @N5O1 Před 3 lety

      я только об это подумал и тут комментарий)