Log incoming requests and outgoing responses

Issue #70 wontfix
Sven Döring created an issue

The internet is full of questions asking how they can log incoming requests and more specifically the content (payload) of those. The same goes for responses.

And well, if the user uses the Swagger Request Validator, which already has much of the data to be logged, why not add logging the request and response to its validation core?

In the simplest version just add log.info("Validate request: {}", request); and log.info("Validate response: {}", response);.

I think that would be a really cool feature with really low effort, @jfnavin.

Besides. I'm just looking for a way to log my requests. 🤖

Comments (3)

  1. Sven Döring reporter

    As the Request and Response does not contain clients information it might be not the right approach. 🤔

  2. James Navin

    I feel like this is outside the scope of the SRV.

    It could be better implemented as a small lib with a simple logging interceptor without bringing in all the baggage of the SRV.

  3. Log in to comment