On Mon, Dec 8, 2014 at 2:45 AM, Marius Gedminas <mar...@pov.lt> wrote: > On Sun, Dec 07, 2014 at 02:33:47PM -0500, John Hupp wrote: >> >> I created /etc/sysctl.d/20-quiet-printk.conf with content: >> kernel.printk = 3 3 3 3 >> ... >> Though I was curious to know a bit more about the mechanisms in >> play, I didn't dig much further than that. I wondered, for >> instance, what behavior the default '4 4 1 7' specified, but never >> did find out. The files in sysctl.d are installed by procps (see >> the List of Files link at >> http://packages.ubuntu.com/trusty/admin/procps). And these, in turn, >> are part of the kernel configuration governed by sysctl (see >> http://manpages.ubuntu.com/manpages/trusty/en/man8/sysctl.8.html). >> >> Still looking for the meaning of '4 4 1 7' vs '3 3 3 3' I came to >> https://www.kernel.org/doc/Documentation/printk-formats.txt, but my >> eyes glazed over just skimming that, and I stopped there. > > This is a bit unobvious, but you can find the description of the > kernel.printk sysctl setting in > http://manpages.ubuntu.com/manpages/trusty/en/man5/proc.5.html: > > /proc/sys/kernel/printk > The four values in this file are console_loglevel, default_mes‐ > sage_loglevel, minimum_console_level, and default_con‐ > sole_loglevel. These values influence printk() behavior when > printing or logging error messages. See syslog(2) for more info > on the different loglevels. Messages with a higher priority > than console_loglevel will be printed to the console. Messages > without an explicit priority will be printed with priority > default_message_level. minimum_console_loglevel is the minimum > (highest) value to which console_loglevel can be set. > default_console_loglevel is the default value for con‐ > sole_loglevel. > > (/proc/sys is one of the possible ways of changing systcl settings, > which I guess explain why this is documented in proc(5).)
You can find the same explanation of the four _loglevels in https://www.kernel.org/doc/Documentation/sysctl/kernel.txt in a more readable format (to my eyes). As mentioned in "man 5 proc", you'll find the explanation of the priorities in "man 2 syslog"; you can also find it in "/usr/include/x86_64-linux-gnu/.../syslog.h" (on x86_64/amd64). "man 2 syslog" on 15.04 also includes the text of the kernel.org document above (clarified/updated). If you're not on 15.04, you can get the latest man-pages (manpages in Ubuntu) from https://www.kernel.org/pub/linux/docs/man-pages/ untar it, and run "man man-pages-3.75/man2/syslog.2" "3 4 1 3" is a more standard setting than "3 3 3 3". It's better to set 4 (WARNING, the vanilla default) rather than 3 (ERR) for messages that don't have a priority, since, if a message really is an error, it'll (should?) be tagged as such. By setting minimum_console_loglevel to 3, you're potentially making printk more verbose on the console. -- Ubuntu-devel-discuss mailing list Ubuntu-devel-discuss@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss