GeezerVison is showing github.com — Add possibility to control MDC values for adding to log message · Issue #6320 · googleapis/google-cloud-java
Add possibility to control MDC values for adding to log message #6320Labels api: loggingIssues related to the Cloud Logging API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. DescriptionThe issue:
All values from MDC are written as labels to each log message, even if there is no need in some of them.
Usually MDC is populated by a built-in components (like MDCInsertingServletFilter) with all possible values, but only several of them are used in log message.
google-cloud-java/google-cloud-clients/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java
for (Map.Entry<String, String> entry : e.getMDCPropertyMap().entrySet()) {
if (null != entry.getKey() && null != entry.getValue()) {
builder.addLabel(entry.getKey(), entry.getValue());
}
}
Possible solution:
- Add possibility to control which MDC values should be added to log message.
- Add Enhancer to add required values of MDC.
Activityadded priority: p2Moderately-important priority. Fix may not be included in next release. type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. on Oct 2, 2019added a commit that references this issue on Oct 3, 2019This issue will close once commit 6a391c5 is merged into the 'master' branch.6a391c5 added a commit that references this issue on Oct 17, 2019This issue will close once commit 7a817b1 is merged into the 'master' branch.7a817b1 gendolf3d commented on Nov 14, 2019 Hello! As I can see the issue gets stucked for a month, may I help somehow? added a commit that references this issue on Nov 14, 2019This issue will close once commit 6c40d9b is merged into the 'main' branch.6c40d9b codyoss commented on Nov 14, 2019 gendolf3d commented on Jan 9, 2020 @codyoss Hello! I'm just curious when it's being planned to merge fix to goolgeapis/java-logging project?
Thank you in advance! codyoss commented on Jan 9, 2020 I will try to get it done today, thanks. codyoss commented on Jan 9, 2020 added a commit that references this issue on Jan 6, 2026This issue will close once commit 46c421c is merged into the 'main' branch.46c421c
MetadataMetadataapi: loggingIssues related to the Cloud Logging API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. DevelopmentNo branches or pull requestsIssue actions
|