target / pod-reaper

Rule based pod killing kubernetes controller
MIT License
200 stars 52 forks source link

Log messages not parsed by Stackdriver #47

Closed MrWako closed 2 years ago

MrWako commented 4 years ago

Firstly thank you for creating this tool - I really like its simplicity. I've been experimenting with it on GCP and whilst not really an issue with pod-reaper, the default Logrus structured logs do not get handled well by the fleuntd/stackdriver collectors, and all the log messages, regardless of severity, get logged as Errors.

I've put together a small PR to allow for different formatting of the logs, let me know what you think.

brianberzins commented 4 years ago

Oh wow! I remember looking at this! I think it's actually deeper than logrus! I think I recall it actually being a golang thing (that some logging frameworks built around!)

Greatly appreciate the kind words. I'll see what I can do to help make it work :-)

brianberzins commented 4 years ago

I wish I could find where I found this when I first looked into everything-getting-logged-to-stderr... but I haven't been able to find it yet.

Some interesting back and forth here: https://github.com/sirupsen/logrus/issues/403#issuecomment-332970055

brianberzins commented 4 years ago

@MrWako Merged and released as 2.5.0! Can you confirm that it's working for you with stack driver?

If everything logging to stderr is painful, I can dig deeper into this. In the most extreme case, it should be possible to force it into using stdout (but I'd want to really understand why they chose stderr if I'm looking to change it)

brianberzins commented 2 years ago

Marking as closed, if something isn't working, please feel free to reopen!