Repository navigation
Support HttpRequest property of LogEntry #1959
Description
Activity
- addedapi: loggingIssues related to the Cloud Logging API.Issues related to the Cloud Logging API.
on Feb 4, 2017 - addedpriority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.
on Feb 27, 2017 @ofrobots can you review this? Is this useful to you?
@zbjornson to make sure my understanding is correct, are you proposing that
loggingautomatically adding the 'current request' to all the log entries that happen to occur on behalf of that request? Or are you proposing an API or contract on Log Entry that would look at a specially named property on the metadata and use it format theHttpRequestfield of the proto message?@ofrobots sorry for being unclear -- I just want a way to be able to set the
HttpRequestproperties from the logging API. Maybe something like:var entry = log.entry({ resource: { ... }, httpRequest: { /* this is what I want to access */ } }, logEntryPayload);
(Think that's the second thing you described.)
This could be something that your new Winston and Bunyan transports populate automatically, but otherwise I don't think the
log.entrymethod behavior should change unless the user adds thehttpRequestproperty explicitly (i.e. don't auto-populate it from the payload).@zbjornson I think we support this currently the same way your example shows. Did we add that feature and forget to tag & close this issue, or is our code (which looks like it will support
httpRequest) not actually working?I'll close this, since I think we figured it out and forgot to close this issue.
- added 2 commits that reference this issue
on Feb 26, 2026 - added a commit that references this issue
on Mar 27, 2026
The v2 logging API supports a top-level HttpRequest property that is separate from the payload:
https://cloud.google.com/logging/docs/api/reference/rest/v2/LogEntry#httprequest
Maybe this could be a special property added to the
metadataargument?Would be useful for the Winston transport PR (#1830) and the Bunyan transport lib (https://github.com/mlazarov/bunyan-stackdriver/).