[systemd-devel] About “systemd-cat --priority=0”
lennart at poettering.net
Mon Mar 11 07:11:13 PDT 2013
On Sun, 10.03.13 21:50, Colin Guthrie (gmane at colin.guthr.ie) wrote:
> 'Twas brillig, and Michal Schmidt at 08/03/13 11:10 did gyre and gimble:
> > Dne 8.3.2013 10:57, Yan Lei napsal(a):
> >> Sorry for troubling you, but I have got an issue to confirm with you.
> >> My issue is when I use the following command:
> >> systemd-cat --priority=0 echo "hello"
> >> Nothing logged into the journal, and the exit code is 141. I wonder
> >> whether it is
> >> a bug or it just work as expected.
> > Looks like a bug to me. Fixed now in git:
> > http://cgit.freedesktop.org/systemd/systemd/commit/?id=e14ddf1cac12f91685cbd5dac6c5127f8cf87863
> In your commit message you said:
> > BTW, I'm not sure why we allow priorities up to 999, but I'm leaving
> this be for now.
We currently allow priorities up to 999 since that's what the RFC suggests:
The PRI part MUST have three, four, or five characters and will be
bound with angle brackets as the first and last characters. The PRI
part starts with a leading "<" ('less-than' character, %d60),
followed by a number, which is followed by a ">" ('greater-than'
character, %d62). The number contained within these angle brackets
is known as the Priority value (PRIVAL) and represents both the
Facility and Severity. The Priority value consists of one, two, or
three decimal integers (ABNF DIGITS) using values of %d48 (for "0")
through %d57 (for "9").
Now, to be frank this RFC5424 defines a lot of stuff that I haven't
really seen in the wild anywhere, like the structured data stuff it
describes (which is different from CEE even), but in this specific
regard mentioned above it is mostly in sync with RFC3164, which simply
documents what is actually used.
> Technically only values up to 998 would be allowed due to the same range
> checking problem you fixed. Whatever the reason for the large levels,
> it's perhaps an oversight that 999 is not allowed?
Oversight. I have fixed that now.
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel