million-views / praas

Proxy as a service.
MIT License
4 stars 2 forks source link

Demonstrate error logging in resource server #92

Closed kavithaii closed 4 years ago

kavithaii commented 4 years ago

Log error to console in development

m5nv commented 4 years ago

When the resource-server (crud-server) is started in development mode, and a client makes an erroneous request, we want to see the error response logged to console. We are using morgan and I recall at some point there were console logs but now we don't see it. This is most likely in how and where the next middleware gets invoked.

5r1n1 commented 4 years ago

Logging enabled with standard option. Tried to log response body in case of an error. This didn't work as expected. Found workaround at https://code-examples.net/en/q/12532c2 Didn't want to write such extensive code just to print body, so enabled logging with standard option

m5nv commented 4 years ago

The task was to demonstrate error logging by investigating how and where the next middleware gets invoked. More specifically how to funnel all error responses throw a single channel. I would appreciate if you discuss before closing an issue. I will take it from here. Thanks.

m5nv commented 4 years ago

Closing this. Superseded by #131.