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

Log HTTP server errors using common/log #1651

Closed
grobie opened this Issue May 24, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@grobie
Copy link
Member

grobie commented May 24, 2016

We currently don't set ErrorLog on the HTTP server, which means that critical errors are being logged using the standard logger instead of the user configurable common/log. See https://golang.org/pkg/net/http/#Server

@mrwacky42

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented May 24, 2016

@alileza Want to give this a try as a beginner issue?

@grobie

This comment has been minimized.

Copy link
Member Author

grobie commented May 24, 2016

The only tricky part is that log.Logger isn't an interface but a struct (grrr golang). Possible implementation could use a buffer as output of the ErrorLog logger, and then read from that logger and call our log function. Given the critical context, we'll need to be sure that this doesn't introduce (too many) new failure cases.

@alileza

This comment has been minimized.

Copy link
Contributor

alileza commented May 24, 2016

@juliusv ah sure i'll working on it

@alileza alileza referenced this issue May 26, 2016

Merged

add ErrorLogger #41

alileza added a commit to alileza/prometheus that referenced this issue May 26, 2016

Log HTTP server errors using common/log
change naming to be more descriptive.
Fixes prometheus#1651

remove pointer receiver

use common/log error logger
@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.