Skip to content

Output event name in SystemOutLogRecordExporter#8609

Draft
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:feat/systemout-log-exporter-event-name
Draft

Output event name in SystemOutLogRecordExporter#8609
thswlsqls wants to merge 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 5 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.

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

1 participant