Hello folks! Welcome back to a new section of our tutorial on ExpressJS. In this tutorial guide, we will be studying about ExpressJS Debugging.
Express uses Debug module to internally log information about middleware functions, route matching, application mode, etc.
To see all internal logs used in Express, set the Debug environment variable to Express:* when starting the app -
Express uses Debug module to internally log information about middleware functions, route matching, application mode, etc.
To see all internal logs used in Express, set the Debug environment variable to Express:* when starting the app -
DEBUG = express:* node index.js
The following output will be displayed -
These logs are helpful when a component of your app isn't working right. This verbose result might be a bit overwhelming. You can also restrict the DEBUG variable to specific area to be logged.
Example
If you wish to restrict the logger to app and router, you can use the following code.
DEBUG = express:application,express:router node index.js
Debug is turned off by default and is turned on automatically in production environment. Debug can also be broadened to meet your requirements, you can read more about it at its npm page.
Alright guys! This is where we are going to be rounding up for this tutorial. In our next tutorial guide, we will be starting our tutorial series on Babel.js.
Feel free to ask your questions where necessary and we will attend to them as soon as possible. If this tutorial was helpful to you, you can use the share button to share this tutorial.
Follow us on our various social media platforms to stay updated with our latest tutorials. You can also subscribe to our newsletter in order to get our tutorials delivered directly to your emails.
Thanks for reading and bye for now.
Feel free to ask your questions where necessary and we will attend to them as soon as possible. If this tutorial was helpful to you, you can use the share button to share this tutorial.
Follow us on our various social media platforms to stay updated with our latest tutorials. You can also subscribe to our newsletter in order to get our tutorials delivered directly to your emails.
Thanks for reading and bye for now.