Skip to content

Support HttpRequest property of LogEntry #1959

Description

@zbjornson

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 metadata argument?

Would be useful for the Winston transport PR (#1830) and the Bunyan transport lib (https://github.com/mlazarov/bunyan-stackdriver/).

Activity

  1. added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Feb 27, 2017
  2. danoscarmike commented on Feb 27, 2017

    @danoscarmike
    Contributor

    @ofrobots can you review this? Is this useful to you?

  3. ofrobots commented on Feb 28, 2017

    @ofrobots
    Contributor

    @zbjornson to make sure my understanding is correct, are you proposing that logging automatically 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 the HttpRequest field of the proto message?

  4. zbjornson commented on Feb 28, 2017

    @zbjornson
    ContributorAuthor

    @ofrobots sorry for being unclear -- I just want a way to be able to set the HttpRequest properties 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.entry method behavior should change unless the user adds the httpRequest property explicitly (i.e. don't auto-populate it from the payload).

  5. stephenplusplus commented on Mar 29, 2017

    @stephenplusplus
    Contributor

    @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?

  6. stephenplusplus commented on Apr 13, 2017

    @stephenplusplus
    Contributor

    I'll close this, since I think we figured it out and forgot to close this issue.

  7. added 2 commits that reference this issue on Feb 26, 2026
    a2f3341
    af1fe0e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

api: loggingIssues related to the Cloud Logging API.priority: p2Moderately-important priority. Fix may not be included in next release.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions