diff --git a/specification/general/logs-general.md b/specification/general/logs-general.md index 1911092ee8..4233c85d71 100644 --- a/specification/general/logs-general.md +++ b/specification/general/logs-general.md @@ -10,13 +10,15 @@ They may be used in any Log Record they apply to. - [General log identification attributes](#general-log-identification-attributes) +- [Log Media](#log-media) + * [Log File](#log-file) + * [I/O Stream](#io-stream) The following semantic conventions for logs are defined: * [General](#general-log-identification-attributes): General semantic attributes that may be used in describing Log Records. -* [Log Media](/specification/logs/semantic_conventions/media.md): Semantic attributes that may be used in describing the source of a log. * [Exceptions](/specification/logs/semantic_conventions/exceptions.md): Semantic attributes that may be used in describing exceptions in logs. * [Feature Flags](/specification/logs/semantic_conventions/feature-flags.md): Semantic attributes that may be used in describing feature flag evaluations in logs. @@ -37,4 +39,31 @@ These attributes may be used for identifying a Log Record. The id MAY be an [Universally Unique Lexicographically Sortable Identifier (ULID)](https://github.com/ulid/spec), but other identifiers (e.g. UUID) may be used as needed. +## Log Media + +This section describes attributes for log media in OpenTelemetry. Log media are mechanisms by which logs are transmitted. Types of media include files, streams, network protocols, and os-specific logging services such as journald and Windows Event Log. + +**Note:** The OpenTelemetry specification defines a [Resource](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.21.0/specification/resource/sdk.md#resource-sdk) as `an immutable representation of the entity producing telemetry`. +The following attributes do not describe entities that produce telemetry. Rather, they describe mechanisms of log transmission. +As such, these should be recorded as Log Record attributes when applicable. They should not be recorded as Resource attributes. + +### Log File + +**Description:** A file to which log was emitted. + +| Name | Notes and examples | +| ------------------------------- | ---------------------------------------------------------------------------------------- | +| `log.file.name` | The basename of the file. Example: `audit.log` | +| `log.file.path` | The full path to the file. Example: `/var/log/mysql/audit.log` | +| `log.file.name_resolved` | The basename of the file, with symlinks resolved. Example: `uuid.log` | +| `log.file.path_resolved` | The full path to the file, with symlinks resolved. Example: `/var/lib/docker/uuid.log` | + +### I/O Stream + +**Description:** The I/O stream to which the log was emitted. + +| Name | Notes and examples | +| ------------------------------- | ---------------------------------------------------------------------------------------- | +| `log.iostream` | The stream associated with the log. SHOULD be one of: `stdout`, `stderr` | + [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.21.0/specification/document-status.md diff --git a/specification/logs/semantic_conventions/media.md b/specification/logs/semantic_conventions/media.md deleted file mode 100644 index ed58410897..0000000000 --- a/specification/logs/semantic_conventions/media.md +++ /dev/null @@ -1,47 +0,0 @@ -# Semantic Conventions for Log Media - -**Status**: [Experimental][DocumentStatus] - -This document describes attributes for log media in OpenTelemetry. Log media are mechanisms by which logs are transmitted. Types of media include files, streams, network protocols, and os-specific logging services such as journald and Windows Event Log. - - - -
-Table of Contents - - - -- [Log Media](#log-media) - * [Log File](#log-file) - * [I/O Stream](#io-stream) - - - -
- -## Log Media - -**Note:** The OpenTelemetry specification defines a [Resource](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.21.0/specification/resource/sdk.md#resource-sdk) as `an immutable representation of the entity producing telemetry`. -The following attributes do not describe entities that produce telemetry. Rather, they describe mechanisms of log transmission. -As such, these should be recorded as Log Record attributes when applicable. They should not be recorded as Resource attributes. - -### Log File - -**Description:** A file to which log was emitted. - -| Name | Notes and examples | -| ------------------------------- | ---------------------------------------------------------------------------------------- | -| `log.file.name` | The basename of the file. Example: `audit.log` | -| `log.file.path` | The full path to the file. Example: `/var/log/mysql/audit.log` | -| `log.file.name_resolved` | The basename of the file, with symlinks resolved. Example: `uuid.log` | -| `log.file.path_resolved` | The full path to the file, with symlinks resolved. Example: `/var/lib/docker/uuid.log` | - -### I/O Stream - -**Description:** The I/O stream to which the log was emitted. - -| Name | Notes and examples | -| ------------------------------- | ---------------------------------------------------------------------------------------- | -| `log.iostream` | The stream associated with the log. SHOULD be one of: `stdout`, `stderr` | - -[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.21.0/specification/document-status.md