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 — feat: auto-populate metadata of log entries at write() by minherz · Pull Request #803 · googleapis/java-logging

This repository was archived by the owner on Feb 6, 2026. It is now read-only.

Conversation

@minherz

@minherz minherz commented Dec 21, 2021

Copy link
Copy Markdown
Contributor

Implements auto-population of metadata (resource info, http requests, trace and span ids, source location).
Respects auto-population LoggingOptions configuration and WriteOption flag.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
minherz added 2 commits December 20, 2021 14:23
@minherz
feat: populate metadata on write()
c121121
@minherz
chore(tests): add unit testing for auto-population
78588b8
change visibility of constants in LoggingImpl and MonitoredResourceUtil to use in tests.
resolve warning in BaseSystemTest by removing unused var.
@minherz
minherz requested a review from losalex December 21, 2021 14:26
@minherz minherz self-assigned this Dec 21, 2021
@minherz
minherz requested review from a team December 21, 2021 14:26
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: logging Issues related to the googleapis/java-logging API. labels Dec 21, 2021
@minherz
chore: LoggingOptionsTest to always use fake project id
fd0f340
losalex
losalex suggested changes Dec 21, 2021
View reviewed changes

@losalex losalex left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, just asking you to shorten a write function

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingImpl.java
builder.setTrace(context.getTraceId());
}
}
}

@losalex losalex Dec 21, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function becomes too bulky and hard to follow - perhaps you can export the part dealing with context into private function?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@minherz minherz Dec 22, 2021

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will look into it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@losalex losalex Dec 22, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@minherz minherz Dec 22, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the trace metadata formatting is moved to a stand-alone method

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingImpl.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

losalex
losalex approved these changes Dec 22, 2021
View reviewed changes
@minherz
chore: refactoring
c0d0451
move the trace metadata formatting to a standalone method.
add comments.
add unit tests to validate resource metadata prioritizing when passed as WriteOption.
fix Context.Builder.setRequest() when passing null.
@minherz
minherz merged commit cfa3db5 into minherz/structured_logging Dec 22, 2021
@minherz
minherz deleted the minherz/691 branch December 22, 2021 13:26
@minherz minherz mentioned this pull request Dec 23, 2021
feat: enable auto-population of missing metadata in logs and printing structured logs to stdout #808
Merged
minherz added a commit that referenced this pull request Dec 30, 2021
@minherz
feat: auto-populate metadata of log entries at write() (#803)
1de2c97
Populate empty metadata fields of each log entry on write().
minherz added a commit that referenced this pull request Jan 4, 2022
@minherz
feat: auto-populate metadata of log entries at write() (#803)
2509188
Populate empty metadata fields of each log entry on write().
minherz added a commit that referenced this pull request Jan 5, 2022
@minherz
feat: auto-populate metadata of log entries at write() (#803)
f485d70
Populate empty metadata fields of each log entry on write().
minherz added a commit that referenced this pull request Jan 7, 2022
@minherz @gcf-owl-bot
feat: enable auto-population of missing metadata in logs and opting l…
bb25d5d
…ogs redirection to stdout in JUL handler (#808)

Aggregates the following work:
- #821
- #812
- #807
- #803
- #798

Fixes #689, #691, #799 and #800

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer
@losalex losalex losalex approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@minherz minherz

Labels

api: logging Issues related to the googleapis/java-logging API. size: m Pull request size is medium.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@minherz @losalex
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.
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.