Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to record request and response at the same line ? #987

Closed
efgod opened this issue Mar 29, 2021 · 1 comment
Closed

how to record request and response at the same line ? #987

efgod opened this issue Mar 29, 2021 · 1 comment

Comments

@efgod
Copy link

efgod commented Mar 29, 2021

Detailed Description

Context

Possible Implementation

Your Environment

  • Version used:
  • Link to your project:
@efgod efgod added the Feature label Mar 29, 2021
@whiskeysierra
Copy link
Collaborator

See https://github.com/zalando/logbook#strategy

In a nutshell:

  • Custom Strategy implementation
    • Implement write(Precorrelation, HttpRequest, Sink) with an empty method body (won't log the request)
    • Implement write(Correlation, HttpRequest, HttpResponse, Sink) by calling sink.writeBoth(correlation, request, response)
  • Custom Sink implementation
    • Implement write(Correlation, HttpRequest, HttpResponse) as you like, e.g. by reusing the DefaultHttpLogFormatter to produce two strings, concat them and then delegate to DefaultHttpLogWriter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants