You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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.
The text was updated successfully, but these errors were encountered: