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

Switch from glog to slog for structured (as well as leveled) logging #4103

Open
scr-oath opened this issue Dec 13, 2024 · 1 comment
Open
Labels

Comments

@scr-oath
Copy link
Contributor

slog wins

glog shortcomings

  • glog has issue with write size - it converts newlines to \n for only as big as will fit in its buffer; beyond that, all newlines are as-is and cause multiple, disjoint, possibly interleaved lines to be written.
  • glog's format does not support things like json for log collectors (like google cloud observability suite, that can query them with BigQuery log analytics)
@linux019
Copy link
Contributor

linux019 commented Jan 24, 2025

Why not choose most popular logger from these ones?
https://github.com/uber-go/zap 22K stars (it's best and allows to attach any sinks eg stdout, UDP writer etc)
https://github.com/rs/zerolog 11K
slog - 416*

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

No branches or pull requests

3 participants