Back to Browse

Learning Winston - A Production Level Logger in Javascript, Node JS | 2024

1.8K views
Mar 9, 2024
32:34

In this video, we will learn about a logger that is widely used in production in the JavaScript environment, whether it's Node.js, TypeScript, React.js, Angular.js, Vue.js, or Vanilla.js. We will learn the following features: 1. We can log in the terminal, file, JSON, or other transport in just one line. 2. Now, based on your application environment, we can restrict which type of log is printed in which environment, e.g., debug, info, warn, error in DEV, info, warn, error in UAT, warn, and error only in Production. 3. Cost Optimization 🔗 Links: Blog: https://bit.ly/3TcvqUF Repository: https://github.com/AmirMustafa/nestjs-task-management/tree/develop PR: https://github.com/AmirMustafa/nestjs-task-management/pull/5 ⏰ Key Moments: 00:00 - Introduction 02:21 - Reviewing Winston SDK Package 05:28 - Understanding Log level order wise print(debug, warn, error, etc) 05:54 - First seeing JS Logs - console.log, console.error, console.info etc. 09:24 - Creating logger directory in root level 10:36 - Setting Dev environment 11:33 - Understanding file logger/indexedDB.ts (Configuring env here) 13:18 - Winston Dev Config - log level debug, printing only in terminal 14:25 - Winston UAT Config - log level debug, printing in terminal + Logging in error.log, combined files 18:08 - Eg1: Printing Port (Dev Environment) 19:07 - Eg2: GetTasks Info in TaskController Postman Log Print (Dev Environment) 21:41 - Eg3: GetTasks Error in TaskService Postman Log Print (Dev Environment) 26:22 - Setting UAT environment 26:57 - Eg1: Printing Port (UAT Environment) | Understanding Diff 27:24 - Checking Logs dumped in error.log and combined files 28:20 - Setting Production environment 28:43 - Eg1: Printing Port (Production Environment) | Understanding Diff 30:16 - Seeing Prod Error Logs in error.log file 31:36 - Quickly changing config in production 32:09 - Wrap up #winston #loggers #javascript Connect with me 👋 LINKEDIN ► https://www.linkedin.com/in/amirmustafa1 INSTAGRAM ► https://www.instagram.com/aamir__mustafa TWITTER ► https://twitter.com/happy_learnings #loggers #nestjs #nodejs #default

Download

0 formats

No download links available.

Learning Winston - A Production Level Logger in Javascript, Node JS | 2024 | NatokHD