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.

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.

NameNotes and examples
log.file.nameThe basename of the file. Example: audit.log
log.file.pathThe full path to the file. Example: /var/log/mysql/audit.log
log.file.name_resolvedThe basename of the file, with symlinks resolved. Example: uuid.log
log.file.path_resolvedThe 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.

NameNotes and examples
log.iostreamThe stream associated with the log. SHOULD be one of: stdout, stderr