A real web server can have a multitude of requests and events happening over a given day. Logging your traffic and activity on your web server can be very important for diagnosing unexpected behaviors after they happen. Express comes ready with a logging module called Morgan that provides all that you will need to record events in your application and even save those events to a log file.
Logging traffic and activity with Morgan
Getting Ready
Let's enhance our logging for our normal HTTP traffic. We'll use a predefined logging format provided by Morgan to record visits to our Angular application and our API usage. We'll also create a custom event log to track admin authorized requests so that we know which admin...