logbook
logbook copied to clipboard
[WIP] Logbook failt tolerancy
Description
This change introduces 2 different fallback mechanisms (possible overlapping):
- in httpclient(5), okhttp(2) and spring interceptors. Where in case of exceptions, logbook will fall back to noop stage and will not faile the overall request/response processing by an application
- in
DefaultLogbook
. Where request stage preparing method (RequestWritingStage process(final HttpRequest originalRequest, final Strategy strategy)
), as well as request writing and response write methods of theDefaultRequestWritingStage
(new inner class) will be intercepting allRuntimeExceptions
and will not fail the request processing. This approach may be sufficient to cover the cases of library dependent interceptors.
Motivation and Context
As of now, when Logbook is causing RuntimeExceptions, it affects not only the ability to write the request/response logs, but prevents clients from operating normally. This should not be the case.
Related issues: https://github.com/zalando/logbook/issues/1693, https://github.com/zalando/logbook/issues/1702
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have added tests to cover my changes.