tapir icon indicating copy to clipboard operation
tapir copied to clipboard

[QUESTION]

Open a-bayat opened this issue 5 years ago • 3 comments

Tapir version: 0.18.3

Scala version: 2.13.7

I want to have response array size and request parameter with it's value to be logged in console. for this purpose I tried to implement ServerLog same as the DefaultServerLog, I couldn't find out how to achieve this.

a-bayat avatar Nov 23 '21 18:11 a-bayat

Maybe logging the Content-length header would be enough? The response might be an arbitrary stream, reading it all into memory might be problematic

adamw avatar Nov 23 '21 21:11 adamw

Ok the length is ok, by the way it's unavailable to have query parameter and it's value ?

a-bayat avatar Nov 24 '21 06:11 a-bayat

You have access to the ServerRequest via DecodeSuccessContext, from there you can read any query parameters

adamw avatar Nov 24 '21 08:11 adamw