From mboxrd@z Thu Jan 1 00:00:00 1970 From: andrzej-kardas@o2.pl (Andrzej Kardas) Date: Sat, 05 Mar 2011 23:22:28 +0100 Subject: about printk and console_loglevel In-Reply-To: References: Message-ID: <4D72B7A4.4090406@o2.pl> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On 05.03.2011 19:42, Siddu wrote: > Hi all, > Hi all, > > I am little stuck understanding this piece of code below and the way > its been working > > Question: since KERN_INFO = 6 # which is msg_log_level > and as per code > *msg_log_level < console_loglevel* > > this line of printk is not supposed to show up in the dmesg log ? but > it is showing up . Why console_loglevel concern messages that should display on the CONSOLE not "dmesg" and controls if message is enough important (read: have prioryty below *console_loglevel) *to display it on the console. You must know that, kernel logs its messages into buffer (into the RAM) which have constant size, when you type dmesg, you simply read messages from that buffer (ring-buffer), so that why you see your line in dmesg. What is more, there is deamon called syslog (rsyslog) which reads this buffer periodically and saves messages in appropriate log file on the hard drive e.g. /var/log/kern.log or /var/log/messages etc. You can configure rsyslog as you wish, to log certain types messages into logfiles. -- regards Andrzej Kardas http://www.linux.mynotes.pl -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110305/0eb6069f/attachment.html