Skip to content

Output severity text in SystemOutLogRecordExporter - #8713

Open
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/systemout-log-exporter-severity-text
Open

Output severity text in SystemOutLogRecordExporter#8713
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/systemout-log-exporter-severity-text

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Fixes #8712

Description

  • SystemOutLogRecordExporter.formatLog() prints the severity number but drops LogRecordData.getSeverityText().
  • Appends [severityText: ...] after the severity and before [eventName: ...], matching the OTLP field order (severity_numberseverity_text → ... → event_name).
  • The OTLP marshalers (LogMarshaler, LogStatelessMarshaler) already serialize both fields, so this aligns the console exporter with them.
  • The two fields are independent: custom levels such as log4j's AUDIT cannot be recovered from the severity enum alone.
  • Nothing is appended when the severity text is null or empty, so existing output is unchanged.
  • Same shape as Output event name in SystemOutLogRecordExporter #8609 (event name), which fixed SystemOutLogRecordExporter does not output the log record event name #8608.

Testing done

  • Added SystemOutLogRecordExporterTest#formatWithSeverityText asserting [severityText: SEVERE] in the formatted line; the existing format() test covers the unset case.
  • ./gradlew :exporters:logging:check — 17 tests passed.
  • No public API change, so no apidiff update.

@thswlsqls
thswlsqls marked this pull request as ready for review August 10, 2026 00:40
@thswlsqls
thswlsqls requested a review from a team as a code owner August 10, 2026 00:40
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Aug 10, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-08-10 01:36 UTC

Review the latest changes.

Non-blocking check failure: codecov/patch

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.65%. Comparing base (d948e13) to head (f65546a).

Files with missing lines Patch % Lines
...y/exporter/logging/SystemOutLogRecordExporter.java 66.66% 0 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (66.66%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8713      +/-   ##
============================================
- Coverage     91.65%   91.65%   -0.01%     
- Complexity    10352    10353       +1     
============================================
  Files          1003     1003              
  Lines         27210    27213       +3     
  Branches       3199     3200       +1     
============================================
+ Hits          24939    24941       +2     
  Misses         1566     1566              
- Partials        705      706       +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 severity text SystemOutLogRecordExporter does not output the log record event name

1 participant