From 72b9f08c76fab78a47d5b0f988dda6ec3aebfa88 Mon Sep 17 00:00:00 2001 From: Dan Jaglowski Date: Tue, 16 Nov 2021 10:16:52 -0500 Subject: [PATCH] Restrict LogRecord Body to string in Logging SDKs Discussions in the Logs SIG have reached consensus that the Body of a LogRecord should be restricted in Logging SDKs. The logs data model technically allows the Body to be arbitrarily structured, but this is only for the sake of preserving the semantics of legacy log formats. It is intended that the Attributes field should be used for all structured logs and the Body should contain only a string message. --- text/logs/0150-logging-library-sdk.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/text/logs/0150-logging-library-sdk.md b/text/logs/0150-logging-library-sdk.md index 00a67988b..61907c52f 100644 --- a/text/logs/0150-logging-library-sdk.md +++ b/text/logs/0150-logging-library-sdk.md @@ -91,7 +91,9 @@ Methods: See LogRecord [data model](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md) -for the list of fields. +for the list of fields. SDKs should restrict the +[Body](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#field-body) +field to a string value. Open Question: should LoggerName field be added to the data model to allow logging libraries to supply it? We have an