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

Syslog and eventlog "formatters" are wrong #82

Closed
fabxc opened this issue Jun 8, 2017 · 2 comments
Closed

Syslog and eventlog "formatters" are wrong #82

fabxc opened this issue Jun 8, 2017 · 2 comments

Comments

@fabxc
Copy link
Contributor

fabxc commented Jun 8, 2017

Both are hooking into logrus' formatting mechanism. This is meant to create a byte slice, which logrus then writes to a sink. Instead both formatters write to their own sync as a side effect. The formatted log lines proceed being printed into the original sink, i.e. stdout.

The side effect is obviously bad as there's stuff logrus does internally afterwards.
But it's also just inconsistent from the configuration side. We pretend the flag flips the sink, when in fact it just adds one that as written to in a non-intended way.

The configuration aspect is possibly too far along to fix.

@amankapoor
Copy link

Hi, the thing which you have mentioned is true, everything is going to stdout. I faced the same problem today. I wanted to write to a file, so I solved it for my purpose. I added a SetOutput function and removed l.Out = w from NewLogger function. You might want to look into it - https://github.com/amankapoor/prometheus-common-log-to-file/.

gouthamve pushed a commit to gouthamve/common that referenced this issue Jul 22, 2018
@brian-brazil
Copy link
Contributor

This relates to the old log library (we use promlog now), which is deprecated and no longer in use.

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

3 participants