@@ -25,11 +25,6 @@ aliases: [/docs/reference/specification/logs/overview]
25
25
- [ OpenTelemetry Collector] ( #opentelemetry-collector )
26
26
- [ Auto-Instrumenting Existing Logging] ( #auto-instrumenting-existing-logging )
27
27
- [ Specifications] ( #specifications )
28
- - [ Trace Context in Legacy Formats] ( #trace-context-in-legacy-formats )
29
- * [ Syslog RFC5424] ( #syslog-rfc5424 )
30
- * [ Plain Text Formats] ( #plain-text-formats )
31
- * [ JSON Formats] ( #json-formats )
32
- * [ Other Structured Formats] ( #other-structured-formats )
33
28
34
29
<!-- tocstop -->
35
30
@@ -329,7 +324,8 @@ The benefit of using an intermediary medium is that how logs are produced and
329
324
where they are written by the application requires no or minimal changes. The
330
325
downside is that it requires the often non-trivial log file reading and parsing
331
326
functionality. Parsing may also be not reliable if the output format is not
332
- well-defined.
327
+ well-defined. For details on recording and parsing trace context,
328
+ see [ Trace Context in Non-OTLP Log Formats] ( ../compatibility/logging_trace_context.md ) .
333
329
334
330
#### Direct to Collector
335
331
@@ -449,57 +445,4 @@ standard output.
449
445
* [ Logs Data Model] ( ./data-model.md )
450
446
* [ Event API] ( ./event-api.md )
451
447
* [ Semantic Conventions] ( ./semantic_conventions/README.md )
452
-
453
- ## Trace Context in Legacy Formats
454
-
455
- Earlier we briefly mentioned that it is possible to modify existing applications
456
- so that they include the Request Context information in the emitted logs.
457
-
458
- [ OTEP0114] ( https://github.com/open-telemetry/oteps/pull/114 ) defines how the
459
- trace context should be recorded in logs. To summarize, the following field
460
- names should be used in legacy formats:
461
-
462
- - "trace_id" for [ TraceId] ( data-model.md#field-traceid ) , hex-encoded.
463
- - "span_id" for [ SpanId] ( data-model.md#field-spanid ) , hex-encoded.
464
- - "trace_flags" for [ trace flags] ( data-model.md#field-traceflags ) , formatted
465
- according to W3C traceflags format.
466
-
467
- All 3 fields are optional (see the [ data model] ( data-model.md ) for details of
468
- which combination of fields is considered valid).
469
-
470
- ### Syslog RFC5424
471
-
472
- Trace id, span id and traceflags SHOULD be recorded via SD-ID "opentelemetry".
473
-
474
- For example:
475
-
476
- ```
477
- [opentelemetry trace_id="102981ABCD2901" span_id="abcdef1010" trace_flags="01"]
478
- ```
479
-
480
- ### Plain Text Formats
481
-
482
- The fields should be recorded according to the customary approach used for a
483
- particular format (e.g. field: value format for LTSV). For example:
484
-
485
- ```
486
- host:192.168.0.1<TAB>trace_id:102981ABCD2901<TAB>span_id:abcdef1010<TAB>time:[01/Jan/2010:10:11:23 -0400]<TAB>req:GET /health HTTP/1.0<TAB>status:200
487
- ```
488
-
489
- ### JSON Formats
490
-
491
- The fields should be recorded as top-level fields in the JSON structure. For example:
492
-
493
- ``` json
494
- {
495
- "timestamp" :1581385157.14429 ,
496
- "body" :" Incoming request" ,
497
- "trace_id" :" 102981ABCD2901" ,
498
- "span_id" :" abcdef1010"
499
- }
500
- ```
501
-
502
- ### Other Structured Formats
503
-
504
- The fields should be recorded as top-level structured attributes of the log
505
- record as it is customary for the particular format.
448
+ * [ Trace Context in non-OTLP Log Formats] ( ../compatibility/logging_trace_context.md )
0 commit comments