Re: [PATCH bpf-next 02/11] bpfilter: Add logging facility
From: Song Liu <hidden>
Date: 2021-05-20 16:36:12
Also in:
netdev
On May 20, 2021, at 12:08 AM, Dmitrii Banshchikov [off-list ref] wrote: On Wed, May 19, 2021 at 10:32:25AM -0700, Song Liu wrote:quoted
On Tue, May 18, 2021 at 11:05 PM Dmitrii Banshchikov [off-list ref] wrote:quoted
There are three logging levels for messages: FATAL, NOTICE and DEBUG. When a message is logged with FATAL level it results in bpfilter usermode helper termination.Could you please explain why we choose to have 3 levels? Will we need more levels, like WARNING, ERROR, etc.?I found that I need one level for development - to trace what goes rignt and wrong. At the same time as those messages go to dmesg this level is too verbose to be used under normal circumstances. That is why another level is introduced. And the last one exists to verify invariants or error condintions from which there is no right way to recover and they result in bpfilter termination.
/dev/kmsg supports specifying priority of the message. Like: echo '<4> This message have priority of 4' > /dev/kmsg Therefore, with proper priority settings, we can have more levels safely. Does this make sense? Thanks, Song [...]