-
Notifications
You must be signed in to change notification settings - Fork 39
feat: enable auto-population of missing metadata in logs and printing structured logs to stdout #808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
754dd90
to
a40e509
Compare
5f484a7
to
f9bda3d
Compare
…e() (#798) Allows to opt-out auto populate log entry metadata on write in the write() API and Logging instance levels. Tests WriteOption to out-out auto populating metadata. Tests LoggingOption to out-out auto populating metadata. Tests default LoggingOption for auto populating metadata. Refactors LoggingOptions tests. Refactors LoggingOptions auto populate metadata getter method. Fixes cast compilation warning.
Populate empty metadata fields of each log entry on write().
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
#812) Implements populateMetadata() API. Changes Logging.write() API to populate the provided list of log entries using the new API. Refactors SourceLocation.fromCurrentContext() to use a list of exclusion instead of the call stack depth level as parameter. Adds configuration `populateToStdout` to `LoggingConfig`. Use the new configuration within `LoggingHandler` to print to STDOUT instead of ingesting the log by calling Logging.write(). Refactor LoggingImpl, LoggingHandler and unit tests.
rename unit tests to reflect the right configuration name being tested. test log enhancers when redirecting to stdout.
c8b0ee8
to
9e575b4
Compare
losalex
reviewed
Jan 5, 2022
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 seems that you didnt merge latest changes which were discussed in previous iterations, can you please take a look and make sure all latest issues are addressed?
google-cloud-logging/src/main/java/com/google/cloud/logging/LogEntry.java
Outdated
Show resolved
Hide resolved
google-cloud-logging/src/main/java/com/google/cloud/logging/LogEntry.java
Outdated
Show resolved
Hide resolved
…ting JUL handler to STDOUT (#821) Add description about automatic metadata population and redirection of JUL logs to stdout to README. Reverse the use of 'appendComma' flag Rename populateMetadata? flags to make the logic clear
…eapis/java-logging into minherz/structured_logging
…eapis/java-logging into minherz/structured_logging
losalex
approved these changes
Jan 6, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
PR aggregates the following changes:
Fixes #689, closes #691, closes #799 and resolves #800