Skip to content

Ability to name logger - GetLogger(name) and retain this information on event #1215

@maxgolov

Description

@maxgolov

What are you trying to achieve?

Most prominent frameworks across different programming languages allow to name a Logger. This is typically done at GetLogger(name) API call, where subsequently the knowledge of logger name is retained on Logger object. When SDK flows the data emitted from the Logger to Exporter, it should be possible for the Logger to pass-thru not only the Event name, but Logger name that emitted this event.

Additional context.

While we are designing Logging API in OpenTelemetry C++ SDK, we are facing a challenge that the spec does not prescribe the Logger to have a name per se. Whereas if you build a shim or exporter from other prominent logging SDKs to OpenTelemetry SDK, you'd actually have to 'remember' the Logger name passed down to it.

References

Logging frameworks that provide named loggers and provide ability to search/grep/export based on logger name:

Example showing visually why it is important for an Event to carry information about what logger emitted this event:

image

Column refers explicitly to what logger name it is.

Similar logic also applies to Android OS / platform code, where there is no logger name concept per se, but it can be implicitly mapped to LOG_TAG: https://stackoverflow.com/questions/8355632/how-do-you-usually-tag-log-entries-android - which allows to group / filter by your "named logger" events from the unified stream of all Logcat messages / events.

Metadata

Metadata

Labels

area:apiCross language API specification issueenhancementNew feature or requestrelease:after-gaNot required before GA release, and not going to work on before GArelease:required-logdatamodel-gaRequired for declaring log data model stablespec:logsRelated to the specification/logs directory

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions