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.
This adds a new HTTP-specific processor that formats logs according to the
HttpRequest
Google Cloud Logging log format.See: https://cloud.google.com/logging/docs/structured-logging#structured_logging_special_fields
See: https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#httprequest
Fix: #32
This introduces:
This can be used in different ways:
Either the user creates the
HTTPRequest
object itself and logs it directly:Or this is implemented as part of a framework (inside WSGI or ASGI or framework-specific middleware for instance), in which case we can offer a dedicated adapter from the framework objects to the
HTTPRequest
format.For this case, the pull request offers an adapter from Starlette request/response + a test with a basic Starlette middleware.