Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 5.6.1
- Added body and event logging in debug level for non 2xx responses [#142](https://github.com/logstash-plugins/logstash-output-http/pull/142)

## 5.6.0
- Added standardized SSL settings and deprecates their non-standard counterparts. Deprecated settings will continue to work, and will provide pipeline maintainers with guidance toward using their standardized counterparts [#140](https://github.com/logstash-plugins/logstash-output-http/pull/140)
- Added new `ssl_truststore_path`, `ssl_truststore_password`, and `ssl_truststore_type` settings for configuring SSL-trust using a PKCS-12 or JKS trust store, deprecating their `truststore`, `truststore_password`, and `truststore_type` counterparts.
Expand Down
15 changes: 9 additions & 6 deletions lib/logstash/outputs/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,15 @@ def log_retryable_response(response)
end

def log_error_response(response, url, event)
log_failure(
"Encountered non-2xx HTTP code #{response.code}",
:response_code => response.code,
:url => url,
:event => event
)
log_details = {
:response_code => response.code,
:url => url,
}
if @logger.debug?
log_details[:event] = event.to_json
log_details[:response_body] = response.body
end
log_failure("Encountered non-2xx HTTP code", log_details)
end

def send_events(events)
Expand Down