Draft
Conversation
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
Owner
Author
|
@petemounce you may be interested by this: this implements something similar to what we discussed in #32
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
HttpRequestGoogle 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
HTTPRequestobject 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
HTTPRequestformat.For this case, the pull request offers an adapter from Starlette request/response + a test with a basic Starlette middleware.