diff --git a/CHANGELOG.md b/CHANGELOG.md index aabb68ba04b..5d609a3de20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ release. ### Logs +- Remove the suggestion that backends or UI may represent log records with unset severity as INFO severity. + Source formats that do not define a concept of severity or log level SHOULD emit INFO. + ([#4509](https://github.com/open-telemetry/opentelemetry-specification/pull/4509)) + ### Baggage ### Resource diff --git a/specification/logs/data-model.md b/specification/logs/data-model.md index f0db90e8c41..f96f6271531 100644 --- a/specification/logs/data-model.md +++ b/specification/logs/data-model.md @@ -328,11 +328,8 @@ For example if the source format has an "Informational" log level and no other log levels with similar meaning then it is recommended to use `SeverityNumber=9` for "Informational". -Source formats that do not define a concept of severity or log level MAY omit -`SeverityNumber` and `SeverityText` fields. Backend and UI may represent log -records with missing severity information distinctly or may interpret log -records with missing `SeverityNumber` and `SeverityText` fields as if the -`SeverityNumber` was set equal to INFO (numeric value of 9). +Source formats that do not define a concept of severity or log level SHOULD +set `SeverityNumber=9`. #### Reverse Mapping diff --git a/specification/logs/supplementary-guidelines.md b/specification/logs/supplementary-guidelines.md index 67346488ad6..80b098b5976 100644 --- a/specification/logs/supplementary-guidelines.md +++ b/specification/logs/supplementary-guidelines.md @@ -198,7 +198,7 @@ type SeverityProcessor struct { // if the record's severity is greater than or equal to p.Min. // Otherwise, the record is dropped (the wrapped processor is not invoked). func (p *SeverityProcessor) OnEmit(ctx context.Context, record *sdklog.Record) error { - if record.Severity() != log.SeverityUndefined && record.Severity() < p.Min { + if record.Severity() < p.Min { return nil } return p.Processor.OnEmit(ctx, record) @@ -206,8 +206,7 @@ func (p *SeverityProcessor) OnEmit(ctx context.Context, record *sdklog.Record) e // Enabled returns false if the severity is lower than p.Min. func (p *SeverityProcessor) Enabled(ctx context.Context, param sdklog.EnabledParameters) bool { - sev := param.Severity - if sev != log.SeverityUndefined && sev < p.Min { + if param.Severity < p.Min { return false } if fp, ok := p.Processor.(sdklog.FilterProcessor); ok {