Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion api/include/opentelemetry/logs/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,11 @@ class Logger
*
* @param severity severity of the log
* @param event_id event identifier of the log
* @param format an utf-8 string following https://messagetemplates.org/
* @param format a UTF-8 string stored as the log record body

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the new note about no SDK-side interpolation is useful, but should we avoid removing the message-template intent entirely? My understanding is that format was kept as a user-facing API concept so custom exporters or upstream agents could interpret it as a message template, even though the OpenTelemetry spec does not require the SDK itself to format it. Maybe this should say that the SDK stores the string as the log record body and does not interpolate attributes, while preserving that exporters/agents may choose to interpret it as a message template.
cc @ThomsonTan - I believe he added the original comment.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original intention is recommending the user to pass in message-template. It is not required for SDK or exporter (we don't do that) to do the interpolation, but everything are there for the interpolation so it could be done later, like in the storage backend. Let's add clarification on this instead of revoing the intention.

* @param attributes key value pairs of the log
*
* @note The @p format string is not interpolated with values from
* @p attributes. Pass structured data through @p attributes.
*/
virtual void Log(Severity severity,
const EventId &event_id,
Expand Down
Loading