Exporter: WithLogger
uses the github.com/go-logr/logr
interface to replace the standard library logger
#3497
Labels
Milestone
Problem Statement
Currently
otel api
andsdk
use globalLogger to print logs. globalLogger uses thegithub.com/go-logr/logr
library, which provides the interface, and the specific log implementation can be determined by the user, which is designed to be flexible.opentelemetry-go/internal/global/internal_logging.go
Lines 30 to 42 in aa868d5
But the Exporter uses golang's standard log library, so the printing of logs in a project will be fragmented, which is not conducive to unified log processing and collection.
opentelemetry-go/exporters/zipkin/zipkin.go
Lines 66 to 72 in aa868d5
I have a project where my logging library of choice is
zap
. When I use the otel api and sdk, I can usegithub.com/go-logr/zapr
to wrap my logger and set the globalLogger, but when I use Exporter, I can't do anything about it, because I can only use golang's standard logging library.Proposed Solution
Exporter uses the
github.com/go-logr/logr
library, which is consistent throughout the projectIf the community agrees with the proposal, I can submit a PR to resolve the issue
The text was updated successfully, but these errors were encountered: