Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add structured Logger interface #37

Open
basvanbeek opened this issue Dec 22, 2017 · 4 comments · May be fixed by #188
Open

Add structured Logger interface #37

basvanbeek opened this issue Dec 22, 2017 · 4 comments · May be fixed by #188

Comments

@basvanbeek
Copy link
Member

We should provide a standard structured logger interface which consumers can inject with an implementation. zipkin-go-opentracing uses an interface compatible with the Go kit logger interface which seems the best candidate.

type Logger interface {
	Log(keyvals ...interface{}) error
}

This will allow people to easily fetch the K/V pairs coming from errors and exceptions within the library and merge them with their application logging infrastructure.

For people not liking structured logging we should provide an adapter for the standard Go log.

@codefromthecrypt
Copy link
Member

codefromthecrypt commented Dec 23, 2017 via email

@basvanbeek
Copy link
Member Author

Yes that is correct. It allows the user of the library decide how to have errors be reported.

kujenga added a commit to kujenga/zipkin-go that referenced this issue Mar 5, 2021
This commit provides users of this library with the ability to configure
any logger of their choosing to be passed into the various components of
this library. Doing so allows use cases such as using other open source
logging packages, e.g. logrus or zap, in conjunction with this library.

Closes openzipkin#37
@kujenga kujenga linked a pull request Mar 5, 2021 that will close this issue
@kujenga
Copy link

kujenga commented Mar 5, 2021

I took a pass at implementing a more complete version of this to use interfaces throughout the package: #188

kujenga added a commit to kujenga/zipkin-go that referenced this issue Mar 27, 2021
This commit provides users of this library with the ability to configure
any logger of their choosing to be passed into the various components of
this library. Doing so allows use cases such as using other open source
logging packages, e.g. logrus or zap, in conjunction with this library.

Closes openzipkin#37
kujenga added a commit to kujenga/zipkin-go that referenced this issue Mar 27, 2021
This commit provides users of this library with the ability to configure
any logger of their choosing to be passed into the various components of
this library. Doing so allows use cases such as using other open source
logging packages, e.g. logrus or zap, in conjunction with this library.

Closes openzipkin#37
@basovnik
Copy link

I would appreciate this feature as well. I would like to integrate zap logger using an interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants