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

add response body logging to non 2xx responses #142

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jsvd
Copy link
Contributor

@jsvd jsvd commented May 9, 2024

Log the response body and the event (in JSON format) when the endpoint returns a non 2xx response.

Before, the logging entry included :event => event, but the event wasn't being displayed at all, it was just an stringified object reference. Given the potential size of the event or response size, both of these are only logged in debug mode.
This PR makes logging more consistent with the retryable error logging.

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link

@andsel andsel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also add a section in the doc describing this behavior

lib/logstash/outputs/http.rb Outdated Show resolved Hide resolved
@jsvd jsvd changed the title add response body and event logging to non 2xx responses add response body logging to non 2xx responses May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants