본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

일반 로그 속성

원문 보기 위키 갱신

Status: Development

출처: 문서

본문

이 섹션에서 설명하는 속성들은 비교적 일반적(generic)이에요. 적용되는 모든 Log Record에서 사용될 수 있어요.

  • 일반 로그 식별 속성

  • Log media

  • Log file

  • I/O Stream

로그를 위한 다음 시맨틱 컨벤션이 정의돼요:

  • General: Log Record를 설명할 때 사용할 수 있는 일반 시맨틱 속성.
  • Exceptions: 로그에서 예외를 설명할 때 사용할 수 있는 시맨틱 속성.

OpenTelemetry는 로그, 이벤트, 추적, 메트릭을 위한 시맨틱 컨벤션 외에도, 자체 Resource Semantic Conventions를 가진 포괄적인 Resource 개념도 정의해요.

일반 로그 식별 속성

이 속성들은 Log Record를 식별하는 데 사용될 수 있어요.

속성:

| | Key | Stability | Requirement Level | Value Type | Description | Example Values

| log.record.original | | Opt-In | string | The complete original Log Record. [1] | 77 <86>1 2015-08-06T21:58:59.694Z 192.168.2.133 inactive - - - Something happened; [INFO] 8/3/24 12:34:56 Something happened

| log.record.uid | | Opt-In | string | A unique identifier for the Log Record. [2] | 01ARZ3NDEKTSV4RRFFQ69G5FAV

[1] log.record.original: This value MAY be added when processing a Log Record which was originally transmitted as a string or equivalent data type AND the Body field of the Log Record does not contain the same value. (e.g. a syslog or a log record read from a file.)

[2] log.record.uid: If an ID is provided, other log records with the same ID will be considered duplicates and can be removed safely. This means, that two distinguishable log records MUST have different values. The ID MAY be an Universally Unique Lexicographically Sortable Identifier (ULID), but other identifiers (e.g. UUID) may be used as needed.

Log media

이 섹션은 OpenTelemetry의 로그 매체(log media) 속성을 설명해요. 로그 미디어는 로그가 전송되는 메커니즘이에요. 미디어 유형에는 파일, 스트림, 네트워크 프로토콜, 그리고 journald나 Windows Event Log 같은 OS 특화 로깅 서비스가 포함돼요.

참고: OpenTelemetry 사양은 Resource를 an immutable representation of the entity producing telemetry 로 정의해요. 다음 속성들은 텔레메트리를 생성하는 엔티티를 설명하지 않아요. 오히려 로그 전송 메커니즘을 설명해요. 그러므로 이들은 해당되는 경우 Log Record 속성으로 기록해야 해요. Resource 속성으로 기록해서는 안 돼요.

Log file

Description: A file to which log was emitted.

속성:

| | Key | Stability | Requirement Level | Value Type | Description | Example Values

| log.file.name | | Recommended | string | The basename of the file. | audit.log

| log.file.name_resolved | | Opt-In | string | The basename of the file, with symlinks resolved. | uuid.log

| log.file.path | | Opt-In | string | The full path to the file. | /var/log/mysql/audit.log

| log.file.path_resolved | | Opt-In | string | The full path to the file, with symlinks resolved. | /var/lib/docker/uuid.log

I/O Stream

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

속성:

| | Key | Stability | Requirement Level | Value Type | Description | Example Values

| log.iostream | | Opt-In | string | The stream associated with the log. See below for a list of well-known values. | stdout; stderr

log.iostream 는 다음과 같은 잘 알려진 값 목록을 가져요. 그중 하나가 해당된다면 해당 값을 반드시 사용해야 하고, 그렇지 않다면 사용자 정의 값을 사용해도 돼요. | | Value | Description | Stability

| stderr | Events from stderr stream |

| stdout | Logs from stdout stream |