I saw a lot of articles about logging and best practices methods for logging. But each of them explained separately some part of logging. Here I want to explain how to start logging in express.js and How to see results in the monitoring tools. and I will go directly into the writing code.
🎥 I strongly recommend you watch this video before start reading this article:
console is one of the built-in functions in node.js. as I said it’s the most basic tool for showing logs in your environment’s console.
I started NodeJs developing 4 years ago. At first, I was working on some urgent projects and I was forced to finish them As soon as possible, and I didn’t have enough time to create any good structure for my Projects.
After a while, I stuck in my Spaghetti Code and I learned if I have 10 minutes to cut all trees, Sharpen my ax for 9 minutes, and 1 minute to cut all trees. And now I want to share my experience of avoiding Spaghetti code and share my code structure.
Life is doing your love. Ready to growing. Sharing my Idea and ready to listen to everyone.