Question: Would it be possible to log request and response in the same log entry?
Hi! One of my teams asked if my team could develop a logbook strategy that would log requests and responses in the same log message.
Example:
>> INCOMING >> AFTER REQUEST
Request: GET /api/endpoint?parameter=allegro-pl
Body: <empty body>
Response: Status 200, took 5 ms
Body: {"works":true}
I can think of some potential problems (but this library solves some) BUT I wanted to know your opinion as maintainers! Did you thought about such feature? Or maybe I missed that this feature is actually supported? :)
friendly ping :)
Hey @bgalek, what you want to achieve is possible to do via a custom Sink implementation, that would write the log only when void write(Correlation correlation, HttpRequest, HttpResponse response) is called. See CommonsLogFormatSink as an example.
In order to prioritize the support for Logbook, we would like to check whether the old issues are still relevant. This issue has not been updated for over six months.
- Please check if it is still relevant in latest version of the Logbook.
- If so, please add a descriptive comment to keep the issue open.
- Otherwise, the issue will automatically be closed after a week.