Open 532910 opened 3 months ago
That's called severity. I thought it works fine, but if we're catching these lines from stdout then journald docs should be checked for possibility of severity detection from them.
That's called severity
in syslog
in systemd it's priority: https://manpages.debian.org/bookworm/systemd/journalctl.1.en.html
-p, --priority= Filter output by message priorities or priority ranges. Takes either a single numeric or textual log level (i.e. between 0/"emerg" and 7/"debug"), or a range of numeric/text log levels in the form FROM..TO. The log levels are the usual syslog log levels as documented in syslog(3), i.e. "emerg" (0), "alert" (1), "crit" (2), "err" (3), "warning" (4), "notice" (5), "info" (6), "debug" (7). If a single log level is specified, all messages with this log level or a lower (hence more important) log level are shown. If a range is specified, all messages within the range are shown, including both the start and the end value of the range. This will add "PRIORITY=" matches for the specified priorities.
I doubt zap
can do prefixes like in https://www.freedesktop.org/software/systemd/man/latest/sd-daemon.html. It also doesn't have a proper set of severities/priorities/levels.
https://git.frostfs.info/TrueCloudLab/zapjournald it was the first link by google(go zap journald)
also journald is supported by zap: https://pkg.go.dev/go.pact.im/x/zapjournal
That one solves a different problem, but maybe can be extended to handle levels in some way.
Also different.
There are two problems here:
We have tried it (actually, have written), so I will just outline some problems we have encountered:
zapjournald
(we still have 1 alloc for trivial cases, but this is because of our requirement to have other native journal fields without them being used as application-level fields). In neo-go, it could be made zero-alloc.
The
No entries
is wrong answer, because there are: