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: configure opt-out metada auto-population for JUL handler by minherz · Pull Request #807 · 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 23, 2021

Copy link
Copy Markdown
Contributor

Allow to opt-out auto-population of the log entries with additional metadata in JUL handler using the flag in LoggingOptions and LoggingConfig configuration.

Opt-out is set if at least one of the above will be set to false. Absence of the configuration is interpreted same as setting the configuration to true.

Sorry, something went wrong.

Uh oh!

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

All reactions
@minherz minherz self-assigned this Dec 23, 2021
@minherz
minherz requested review from a team December 23, 2021 11:39
@product-auto-label product-auto-label Bot added size: s Pull request size is small. api: logging Issues related to the googleapis/java-logging API. labels Dec 23, 2021
@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
losalex
losalex reviewed Dec 23, 2021
View reviewed changes
Comment thread google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingHandler.java
return logging;
}

private static boolean isTrueOrNull(Boolean b) {

@losalex losalex Dec 23, 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.

nit: Such methods ideally should accept additional variable with default value to be returned in case if checked parameter is null.

Sorry, something went wrong.

Uh oh!

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

All reactions

@minherz minherz Dec 23, 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.

It is not "getter". This method is used to answer the question whether the parameter is null or Boolean.TRUE.

Sorry, something went wrong.

Uh oh!

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

All reactions

@losalex losalex Dec 23, 2021 •
edited
Loading

Uh oh!

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

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.

nit: I was kinda suggesting to make it "getter", so it can be reused later if needed

Sorry, something went wrong.

Uh oh!

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

All reactions

@minherz minherz Dec 23, 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.

There is "getter":

java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingHandler.java

Lines 401 to 403 in 6bc345c

public Boolean getAutoPopulateMetadata() {
return this.autoPopulateMetadata;
}

The above is a service method used at initialization only to enforce opt-out if one of the original sources of the configuration: LoggingOptions or config file has it set to FALSE. However, if the configuration is omitted then it should be interpreted as "allowed" according to the design requirement: to allow by default.

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/LoggingHandler.java Resolved

Uh oh!

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

Comment thread google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingHandler.java Resolved

Uh oh!

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

minherz added 3 commits December 23, 2021 18:30
@minherz
feat: add opt-out configuration for metadata population to JUL handler
44327ec
adds metadata auto-population flag to JUL handler.
adds metadata auto-population flag to logging config file.
forwards metadata auto-population flag via WriteOption to write() calls.
refactors JUL handler tests to remove duplication, unused calls and warnings
@minherz
chore: test JUL handler with enabled auto-population
632936a
@minherz
chore: remove not needed param comment
6bc345c
@minherz
minherz force-pushed the minherz/799 branch from 173c195 to 6bc345c Compare December 23, 2021 18:30
losalex
losalex approved these changes Dec 23, 2021
View reviewed changes
@minherz
minherz merged commit a9db521 into minherz/structured_logging Dec 23, 2021
@minherz
minherz deleted the minherz/799 branch December 23, 2021 19:18
minherz added a commit that referenced this pull request Dec 30, 2021
@minherz
feat: configure opt-out metada auto-population for JUL handler (#807)
eb1fe11
Adds metadata auto-population flag to JUL handler.
Adds metadata auto-population flag to logging config file.
Forwards metadata auto-population flag via WriteOption to write() calls.
Refactors JUL handler tests to remove duplication, unused calls and warnings
minherz added a commit that referenced this pull request Jan 4, 2022
@minherz
feat: configure opt-out metada auto-population for JUL handler (#807)
e7ff581
Adds metadata auto-population flag to JUL handler.
Adds metadata auto-population flag to logging config file.
Forwards metadata auto-population flag via WriteOption to write() calls.
Refactors JUL handler tests to remove duplication, unused calls and warnings
minherz added a commit that referenced this pull request Jan 5, 2022
@minherz
feat: configure opt-out metada auto-population for JUL handler (#807)
072dec3
Adds metadata auto-population flag to JUL handler.
Adds metadata auto-population flag to logging config file.
Forwards metadata auto-population flag via WriteOption to write() calls.
Refactors JUL handler tests to remove duplication, unused calls and warnings
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: s Pull request size is small.

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.