Changing The Linux System Log Levels - Inspur OS Installation Manual

Table of Contents

Advertisement

p - dump current CPU registers and flags
c - intentionally crash the system
s - immediately sync all mounted filesystems
u - immediately remount all filesystems read-only
b - immediately reboot the machine
o - immediately power off the machine (if configured and supported)
f - start the Out Of Memory Killer (OOM)
It is common to use the first 5 combination keys (i.e. m, w, t, p and c) to collect
system status when the RHEL OS crashes.
For example, press <Alt>, <SysRq> and <c> to trigger a system crash and collect
vmcore: the pre-configured kdump will export the memory information to
generate a vmcore file.
10.5

Changing the Linux System Log Levels

The kernel uses the log level to specify the importance of a message, and decides
whether to show the message immediately by printing it to the current console (or
the serial port or even a printer).
To this end, the kernel will compare the log level of the message with
console_loglevel (a kernel variable). If the message priority is higher (lower log
level value) than the console_loglevel, the message will be printed to the current
console.
1.
Query the console log level.
Execute the cat /proc/sys/kernel/printk command on Linux. In this example, the
first number in the return message indicates that the console log level is 3:
#cat /proc/sys/kernel/printk
3
4
1
7
2.
Change the console log level.
The method is only valid for the current runtime. After the OS restarts, the console
log level is restored to the log level specified in the configuration file. Execute the
echo N > /proc/sys/kernel/printk command in the OS. N indicates the console log
level to be set. For details, refer to the following table.
Table10-1 Console Log Levels
Level
Kernel Log Level
Description
257

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents