GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Allow customization for context of LogEntry instances created by LoggingHandler · Issue #1329 · googleapis/google-cloud-java

Allow customization for context of LogEntry instances created by LoggingHandler  #1329

New issue
Copy link
New issue
Copy link
Closed
Closed
Allow customization for context of LogEntry instances created by LoggingHandler #1329
Copy link
Assignees
garrettjonesgoogle
Labels
api: loggingIssues related to the Cloud Logging API.

Description

@gregw
gregw
opened on Oct 21, 2016
Issue body actions

The https://github.com/GoogleCloudPlatform/jetty-runtime needs to be able to generate stackdriver log messages with the label traceid set the the value obtained from the x-cloud-trace-context HTTP header.

However, the LoggingHandler#getLogEntry method does not allow for easy extension to support traceid as the method is private rather than protected, thus to change behaviour more methods on the class need to be replaced to customize the LogEntry.

If this method could be made protected, then it would be easy to extend the handler to use a threadlocal label map to set additional labels (eg traceid).

Better yet, such a threadlocal context could be implemented as a standard feature of the LogHandler?

Activity

Next
  1. mziccard
    added
    api: loggingIssues related to the Cloud Logging API.
    on Oct 21, 2016
  2. mziccard commented on Oct 21, 2016

    @mziccard
    mziccard
    on Oct 21, 2016
    Contributor
    More actions

    If this method could be made protected, then it would be easy to extend the handler to use a threadlocal label map to set additional labels (eg traceid).

    This sounds good to me.

    Better yet, such a threadlocal context could be implemented as a standard feature of the LogHandler?

    I am not sure this is a feature that a lot of users would use/need.

  3. gregw commented on Oct 21, 2016

    @gregw
    gregw
    on Oct 21, 2016
    Author
    More actions

    @mziccard Do you want a PR for the change to protected?

    With regards to a threadlocal mechanism, I agree it is not entirely widely applicable, but neither does it have a zero use-case. Other logging mechanisms (Eg logback MDC) do provide this feature and indeed the stackdrive log API has the map of labels as an extensible mechanism for such logging that is essentially hidden by the JUL handler.

    If there is zero interest from you guys for this feature, I'll drop it. But if there is a hint of interest I'm happy to create a PR to show how it may be done with minimal cost to users that do not use it.

  4. mziccard commented on Oct 24, 2016

    @mziccard
    mziccard
    on Oct 24, 2016
    Contributor
    More actions

    If there is zero interest from you guys for this feature, I'll drop it. But if there is a hint of interest I'm happy to create a PR to show how it may be done with minimal cost to users that do not use it.

    @gregw I'd be happy to have such a PR. If we can make its cost close-to-zero it'd be nice to have.

    @mziccard Do you want a PR for the change to protected?

    Should we put this on hold while we evaluate the threadlocal mechanism?

  5. gregw
    added a commit that references this issue on Nov 10, 2016

    Issue googleapis#1329

    df8944d
  6. gregw commented on Nov 10, 2016

    @gregw
    gregw
    on Nov 10, 2016
    Author
    More actions

    @mziccard I considered a few ways to do the ThreadLocal, and I'm not sure there is a one size fits all approach. The PR #1385 is a minimal approach to at least allow me to progress on https://github.com/GoogleCloudPlatform/jetty-runtime without needing to copy over the entire LoggingHandler.

    The down side of using inheritance rather than pluggability is that the one external impl cannot work for both AsyncLoggingHandler and LoggingHandler, but at least an external impl is possible.

  7. gregw
    added 3 commits that reference this issue on Nov 17, 2016

    Issue googleapis#1329

    6c704d7

    Issue googleapis#1329

    69c7510

    Issue googleapis#1329

    9fd9d0e
  8. garrettjonesgoogle
    added a commit that references this issue on Nov 18, 2016

    New enhanceLogEntry protected method for overriding (#1385)

    628b7c9
  9. garrettjonesgoogle commented on Nov 18, 2016

    @garrettjonesgoogle
    garrettjonesgoogle
    on Nov 18, 2016
    Contributor
    More actions

    Resolved in #1385

  10. garrettjonesgoogle
    closed this as completedon Nov 18, 2016
  11. gregw commented on Nov 22, 2016

    @gregw
    gregw
    on Nov 22, 2016
    Author
    More actions

    Is there an ETA on a 6.1 release with this change?

  12. garrettjonesgoogle commented on Nov 22, 2016

    @garrettjonesgoogle
    garrettjonesgoogle
    on Nov 22, 2016
    Contributor
    More actions

    I'm aiming to do a release by EOD tomorrow - I have a couple more things to include.

  13. JustinBeckwith
    assigned
    garrettjonesgoogle
    on Feb 1, 2021
  14. 1 remaining item

  15. meltsufin
    added a commit that references this issue on Dec 22, 2025

    deps: update dependency org.junit.vintage:junit-vintage-engine to v5.…

    dfb98f4
  16. chingor13
    added 2 commits that reference this issue on Jan 6, 2026

    deps: update dependency com.google.cloud:sdk-platform-java-config to …

    7e46520

    chore(main): release 0.131.8-alpha (#1335)

    125b450
  17. chingor13
    added a commit that references this issue on Jan 22, 2026

    feat: Java datastore gapic upgrade (#1824)

    a296d43
  18. chingor13
    added a commit that references this issue on Feb 24, 2026

    chore: add java-shared-config as parent for consolidated version mana…

    9e6cdb9
  19. suztomo
    added a commit that references this issue on Mar 11, 2026

    deps: update dependency org.junit.vintage:junit-vintage-engine to v5.…

    0517f28
  20. chingor13
    added a commit that references this issue on Mar 12, 2026

    chore: add java-shared-config as parent for consolidated version mana…

    102019f
  21. lqiu96
    added a commit that references this issue on Mar 20, 2026

    feat: Java datastore gapic upgrade (#1824)

    b80fba0
  22. suztomo
    added a commit that references this issue on Mar 23, 2026

    chore(deps): update dependency com.google.cloud:google-cloud-spanner-…

    26b7854
  23. suztomo
    added a commit that references this issue on Mar 30, 2026

    chore(deps): update dependency com.google.cloud:google-cloud-nio to v…

    ba1fa8d
  24. lqiu96
    added a commit that references this issue on Apr 1, 2026

    chore(deps): update dependency com.google.cloud:google-cloud-nio to v…

    37f528c
  25. meltsufin
    added 2 commits that reference this issue on Apr 29, 2026

    deps: update dependency com.google.cloud:google-cloud-core to v2.8.20 (…

    c37b88e

    deps: update dependency com.google.cloud:google-cloud-core to v2.8.20 (…

    0a42a37
  26. benjaminp
    added 2 commits that reference this issue on Jul 13, 2026

    build(deps): update dependency org.codehaus.mojo:extra-enforcer-rules…

    e1f9291

    feat: Support Cloud Bigtable Changestream (googleapis#1569)

    99071f0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @garrettjonesgoogle
    garrettjonesgoogle

Labels

api: loggingIssues related to the Cloud Logging API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.