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

Use custom http.Server#ErrorLog implementation #23

Open
bluekeyes opened this issue Mar 6, 2020 · 3 comments
Open

Use custom http.Server#ErrorLog implementation #23

bluekeyes opened this issue Mar 6, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@bluekeyes
Copy link
Member

I realized today that http.Server instances have an ErrorLog property that they use to log internal errors with connections. We should consider replacing this with a Zerolog wrapper so that the logs all have a standard format. Unfortunately, log.Logger is not an interface, so we'll have to do the translation based on the literal text written to an io.Writer.

@bluekeyes bluekeyes added the enhancement New feature or request label Mar 6, 2020
@hermanbanken
Copy link

It is sad that no interface is used for the logger. Now we can not use various solutions like zap.

@asvoboda
Copy link
Member

I wonder if we want to consider something like https://github.com/go-logr/logr or https://pkg.go.dev/golang.org/x/exp/slog, with zerolog implementations?

@jamestoyer
Copy link
Contributor

I would +1 go-logr/logr if we decided to bite the bullet here. It's probably worth keeping in mind that golang is also trying to introduce structured logging into the language by default golang/go#56345

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants