Skip to content

Commit 7f8e5ee

Browse files
committed
Add optional Exception parameter to Emit LogRecord
1 parent 08c6611 commit 7f8e5ee

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ release.
2020

2121
- Add optional Ergonomic API.
2222
([#4741](https://github.com/open-telemetry/opentelemetry-specification/pull/4741))
23+
- Add optional `Exception` parameter to Emit LogRecord.
24+
([#4824](https://github.com/open-telemetry/opentelemetry-specification/pull/4824))
2325

2426
### Baggage
2527

specification/logs/api.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ The API MUST accept the following parameters:
126126
- [Attributes](./data-model.md#field-attributes) (optional)
127127
- [Event Name](./data-model.md#field-eventname) (optional)
128128

129+
**Status**: [Development](../document-status.md) - Languages that support exceptions SHOULD accept the following parameter:
130+
131+
- Exception (optional): An exception associated with the log record.
132+
129133
### Enabled
130134

131135
To help users avoid performing computationally expensive operations when

specification/logs/sdk.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,11 @@ However, the changes MUST be eventually visible.
224224
If [Observed Timestamp](./data-model.md#field-observedtimestamp) is unspecified,
225225
the implementation SHOULD set it equal to the current time.
226226

227+
**Status**: [Development](../document-status.md) - If an
228+
[Exception](api.md#emit-a-logrecord) is provided, the SDK MUST set attributes
229+
from the exception on the `LogRecord` with the conventions outlined in the
230+
[exception semantic conventions](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/exceptions/exceptions-logs.md).
231+
227232
**Status**: [Development](../document-status.md) Before processing a log record,
228233
the implementation MUST apply the filtering rules defined by the
229234
[LoggerConfig](#loggerconfig) (in case `Enabled` was not called prior to

0 commit comments

Comments
 (0)