semantic-conventions/specification/logs/semantic_conventions/media.md

2.3 KiB

Semantic Conventions for Log Media

Status: Experimental

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

Note: The OpenTelemetry specification defines a Resource 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.

Attribute Type Description Examples Requirement Level
log.file.name string The basename of the file. audit.log Recommended
log.file.path string The full path to the file. /var/log/mysql/audit.log Opt-In
log.file.name_resolved string The basename of the file, with symlinks resolved. uuid.log Opt-In
log.file.path_resolved string The full path to the file, with symlinks resolved. /var/lib/docker/uuid.log Opt-In

I/O Stream

Description: The I/O stream to which the log was emitted.

Attribute Type Description Examples Requirement Level
log.iostream string The stream associated with the log. See below for a list of well-known values. stdout Opt-In

log.iostream MUST be one of the following:

Value Description
stdout Logs from stdout stream
stderr Events from stderr stream