Re: [PATCH] printk: Add loglevel for "do not print to consoles".

From: Sergey Senozhatsky
Date: Wed May 13 2020 - 02:26:59 EST


On (20/04/30 01:35), Tetsuo Handa wrote:
> Below is the default rules for rsyslog-8.24.0-52.el7 (userspace syslog daemon).
> Of course administrators can modify as needed, but notice that KERN_INFO is saved
> to /var/log/messages but KERN_DEBUG is saved to nowhere.
>
> ----------
> # Log all kernel messages to the console.
> # Logging much else clutters up the screen.
> #kern.* /dev/console
>
> # Log anything (except mail) of level info or higher.
> # Don't log private authentication messages!
> *.info;mail.none;authpriv.none;cron.none /var/log/messages
>
> # The authpriv file has restricted access.
> authpriv.* /var/log/secure
>
> # Log all the mail messages in one place.
> mail.* -/var/log/maillog
>
>
> # Log cron stuff
> cron.* /var/log/cron
>
> # Everybody gets emergency messages
> *.emerg :omusrmsg:*
>
> # Save news errors of level crit and higher in a special file.
> uucp,news.crit /var/log/spooler
>
> # Save boot messages also to boot.log
> local7.* /var/log/boot.log
> ----------

Yes, but this looks like it's the consumer of the messages who
decides what to filter and what not to. rsyslog, dmesg, etc.
will have different filtering policies. It's not like the kernel
decides what to hide and what to show. If would compare this to
NO_CONSOLES, then NO_CONSOLES does a different thing after all.

-ss