Skip to content

Output event name in SystemOutLogRecordExporter - #8609

Merged
jack-berg merged 1 commit into
open-telemetry:mainfrom
thswlsqls:feat/systemout-log-exporter-event-name
Jul 17, 2026
Merged

Output event name in SystemOutLogRecordExporter#8609
jack-berg merged 1 commit into
open-telemetry:mainfrom
thswlsqls:feat/systemout-log-exporter-event-name

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Fixes #8608

Description

  • SystemOutLogRecordExporter.formatLog() did not print the log record's event name; it now appends [eventName: <name>] after the severity when one is set.
  • This aligns the debug exporter with the OTLP log exporters, which already serialize LogRecord.EVENT_NAME (LogStatelessMarshaler, LogMarshaler).
  • LogRecordData.getEventName() is a stable log data-model field (stabilized in Stabilize log record event name #7277); this exporter was not updated when the field was added.
  • Output is unchanged when the event name is null or empty.

Testing done

  • Added SystemOutLogRecordExporterTest#formatWithEventName for the event-name-present case; the existing format test covers the absent case.
  • ./gradlew :exporters:logging:check — 16 tests passed.
  • User-facing output change, so a ## Unreleased CHANGELOG entry is included. No public API change (formatLog is package-private), so no apidiff update.

Related: PR #6591 updated formatLog's body field when the data model changed.

@thswlsqls
thswlsqls force-pushed the feat/systemout-log-exporter-event-name branch from 0791207 to 171d0bf Compare July 16, 2026 19:49
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.63%. Comparing base (6f6e146) to head (171d0bf).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
...y/exporter/logging/SystemOutLogRecordExporter.java 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8609      +/-   ##
============================================
+ Coverage     91.62%   91.63%   +0.01%     
- Complexity    10321    10327       +6     
============================================
  Files          1013     1013              
  Lines         27287    27299      +12     
  Branches       3203     3206       +3     
============================================
+ Hits          25001    25015      +14     
+ Misses         1559     1558       -1     
+ Partials        727      726       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thswlsqls
thswlsqls marked this pull request as ready for review July 17, 2026 05:44
@thswlsqls
thswlsqls requested a review from a team as a code owner July 17, 2026 05:44
Comment thread CHANGELOG.md

## Unreleased

### SDK

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No need to change this PR, but in future PRs no need to add a changelog entry. We generate changelog at release time.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the heads-up — I'll skip the changelog entry in future PRs.

@jack-berg
jack-berg merged commit ea86a68 into open-telemetry:main Jul 17, 2026
30 checks passed
@otelbot

otelbot Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution @thswlsqls! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Jul 17, 2026

Copy link
Copy Markdown

Pull request dashboard status

Status: This pull request has been merged.

@thswlsqls
thswlsqls deleted the feat/systemout-log-exporter-event-name branch July 18, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SystemOutLogRecordExporter does not output the log record event name

2 participants