We now have a youtube channel. Subscribe!

Express.js | Debugging

Express.js | Debugging


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 -

DEBUG = express:* node index.js

The following output will be displayed -

debugging

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.

Post a Comment

Hello dear readers! Please kindly try your best to make sure your comments comply with our comment policy guidelines. You can visit our comment policy page to view these guidelines which are clearly stated. Thank you.
© 2022 ‧ WebDesignTutorialz. All rights reserved. Developed by Jago Desain