[FOR-4925] New annotation, only log response and not request #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To cut down on number of logs, only the response should be logged and not the request.
Normally for every request there will be two logs, one for request that will inform about the method, context-path and potential request-body, and one identical but with response, millis and entity. We only need the latter log if it's a GET request.
Task
https://obos-bbl.atlassian.net/browse/FOR-4925
Changes
@LogOnlyResponseExample
To use it you have to set
LogOnlyResponsetotruelike this@LogOnlyResponse(true)or like this@LogOnlyResponse(value = true)Without the annotation
2024-08-14 09:41:43,628 INFO [0fe1aef1-81b8-1337-hello-0021a8dff2fd] n.o.u.s.client.ClientLogFilter GET http://app.obos.no/bolig/v4/api/selskap/1445/organisasjonsnumre2024-08-14 09:41:43,646 INFO [0fe1aef1-81b8-1337-hello-0021a8dff2fd] n.o.u.s.client.ClientLogFilter GET http://app.obos.no/bolig/v4/api/selskap/1445/organisasjonsnumre response: 200, millis: 18With the annotation
2024-08-14 09:41:43,646 INFO [0fe1aef1-81b8-1337-hello-0021a8dff2fd] n.o.u.s.client.ClientLogFilter GET http://app.obos.no/bolig/v4/api/selskap/1445/organisasjonsnumre response: 200, millis: 18