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

Info logs are written to stderr #60

Open
adriferracuti opened this issue Sep 13, 2021 · 1 comment
Open

Info logs are written to stderr #60

adriferracuti opened this issue Sep 13, 2021 · 1 comment

Comments

@adriferracuti
Copy link

Hi, first of all thank you very much!

I noticed that the info logs are written to stderr, thus showing up as errors on the GCP logs explorer (Kubernetes):
Screenshot 2021-09-13 at 15 04 51

@mac2000
Copy link

mac2000 commented Nov 25, 2021

Seems like it is by design, from docs:

That logger writes to standard error and prints the date and time of each logged message.

So with standard packages all fmt.Print("Hello") goes to stdout, and log.Print("World") to stderr

Workaround for this might be to redefine output with help of SetOutput, like:

log.SetOutput(os.Stdout)

Or even add an optional flag that will switch behavior

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

No branches or pull requests

2 participants