Calypso HTTP Request Logging

I have been looking through Calypso a lot recently and I love how all of the HTTP requests are logged to console so that developers can see exactly what requests are taking place.  Since Calypso is built on Node.js they have the ability to use any node module they want and they chose to use morgan.

What is Morgan?

Morgan is HTTP Request logging tool.  It is very basic but very useful to developers who are working with an API, like the WordPress API.  With morgan you are able determine what http requests are logged and how they are logged.  You can read up on all of the options at the Github page.

Calypso uses two different types of logging based on the server environment, whether its a development, staging or live.  You can see this code within the /server/boot/index.js file.

Thats it!  Morgan is a pretty simple tool and I just wanted other developers to know what Calypso uses for HTTP request logging and where the code is defined to perform the logging.

Leave a Reply