-
Notifications
You must be signed in to change notification settings - Fork 257
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
Improve signalling for JSON payloads #1293
Labels
Comments
In order to prioritize the support for Logbook, we would like to check whether the old issues are still relevant.
|
Still relevant, might also be interesting to add some metadata indicating if/how a payload was filtered, i.e. "4500 bytes was filtered" etc. See also #1330 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For the combination JSON logging and JSON request/response payloads, make it so that processing details relevant for logging are propagated, so that duplicate work can be avoided.
Detailed Description
Currently JSON payloads are append as raw content within JSON request/response-logging statements. This means that payloads with invalid JSON syntax can / will result in log statements with invalid JSON syntax too. So log accumulation tools will not be able to parse the statement as JSON, and might discard the message, or fall back to handle the log statement as pure text.
However existing body-filters and/or databinding performed in the service may be leveraged to guarantee that the payloads are in fact valid JSON. The logging subsystem can safely append the raw data if it knows that the body
If those parameters are unknown, the logging subsystem can attempt to validate the JSON syntax itself and remove newlines. Then continuing to append the payload as raw content, or escaping the payload as JSON text if invalid JSON syntax.
Context
A JSON message might be parsed up to three times,
The last might be avoided.
Possible Implementation
Add a wrapper for body. This would be a breaking change.
The text was updated successfully, but these errors were encountered: