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

Logging on standard err #26

Closed
ghost opened this issue Nov 8, 2018 · 5 comments
Closed

Logging on standard err #26

ghost opened this issue Nov 8, 2018 · 5 comments

Comments

@ghost
Copy link

ghost commented Nov 8, 2018

It seems like the logging library used (github.com/Sirupsen/logrus) logs everything to stderr.

@freddd says that it’s a known logrus problem and would suggest using https://github.com/uber-go/zap instead).

@freddd
Copy link

freddd commented Nov 8, 2018

For reference:

Are you interested in assisting in maintaining Logrus? Currently I have a lot of obligations, and I am unable to provide Logrus with the maintainership it needs. If you'd like to help, please reach out to me at simon at author's username dot com. - https://github.com/sirupsen/logrus/blob/master/README.md

@tredman
Copy link
Contributor

tredman commented Nov 8, 2018

Hi, can you help me understand what problem you're trying to solve by having the agent write to stdout? My understanding is that the usual pattern is: program output -> stdout, program logs -> stderr. Given that the "output" of the agent is Honeycomb events and the logs emitted by the agent are mostly for debugging and informational purposes, this seems appropriate, but maybe I am missing something.

tredman added a commit that referenced this issue Nov 8, 2018
… warn to stdout

Addresses #26 by providing a new config option, `splitLogging`, to enable certain log severities to go to stdout rather than stderr. I chose to make this optional as I do not want to introduce new behavior into the agent for all users, which may rely on everything going to stderr.
@freddd
Copy link

freddd commented Nov 8, 2018

Hi @tredman, Sure. In Google Stackdriver if you pipe to stderr it will automatically assume it's an error no matter what level or severity is set to. Because of this all debugging/informational logs going to stderr will basically drown the real errors causing lots of false positives and more or less making the alerts you might have on error logs useless.

Thanks for responding so quickly!

@tredman
Copy link
Contributor

tredman commented Nov 8, 2018

Hi @freddd and @mariana-bocoi - we've patched our agent to allow optionally splitting stdout and stderr by severity. (trace, debug, info, warn to stdout, everything higher to stderr) It's sort of a workaround as we don't have the cycles to swap out our log lib at the moment. If you redeploy the agent with the latest image and specify splitLogging: true in the ConfigMap, you should get the behavior you need. Here's a link to a sample config: https://github.com/honeycombio/kubernetes-manifests/blob/master/logs/quickstart.yaml#L69-L71

@ghost
Copy link
Author

ghost commented Nov 9, 2018

Thanks!

@ghost ghost closed this as completed Nov 9, 2018
This issue was closed.
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