Overview System Log
The log information is categorized into eight levels, including: emergencies, alerts, critical, errors, warnings, notifications, informational, and debugging. Here levels 0-6 are log information and level 2 is debugging information. For details, refer to the following table.
Table 9-1 Description of the System Log Level Fields
Field
|
Level
|
Description
|
emergencies
|
0
|
Fatal fault. The system is unavailable, the device stops and it needs to be restarted.
|
alerts
|
1
|
Serious error. Functions of a certain type become unavailable, and the services are stopped.
|
critical
|
2
|
Critical error. Irreversible problems occur on the functions of a certain type, and some functions are affected.
|
errors
|
3
|
Error message.
|
warnings
|
4
|
Warning message.
|
notifications
|
5
|
Event notification message.
|
informational
|
6
|
Message prompt and notification.
|
debugging
|
7
|
Debugging message.
|
The log information is outputted to five directions: control console (Console terminal), monitor console (Telnet or SSH terminal), log server, log files (memory log files and flash log files), and email. The output to the five directly is controlled by respective configuration commands. The debugging information is outputted to two directions, control console and monitor console. The log information can also be configured to output to the log server or log files.
Table 9-2 Log Output Directions
Log Output Direction
|
Description
|
Control console
|
The log information is outputted to the Console terminal.
|
Monitor console
|
The log information is outputted to the Telnet or SSH terminal.
|
Log server
|
The log information is outputted to the log server.
By default, logs of levels 0-5 are outputted to the log server.
|
Log files
|
The log information is outputted to the system memory or flash memory.
By default, log information of levels 0-5 is outputted to the system memory, and log information of levels 0-5 is outputted to the flash memory.
|
email
|
The log information is output to the email.
By default, the logs of levels 0-4 are outputted to the log email.
|
The log module runs in a separate syslog process. The main thread of the syslog process receives the log information sent by the system. Firstly, process the log data and distribute the cache space. Then, load the configured output actions to the corresponding buffer queue of each output terminal. Because of the length limitation of the cache queue, when a large number of log information is output, there is a loss of log information. At this time, the log module will count the lost messages. There are two threads in the output of log scheduling (when the log information is output to the console, monitor, log server, run in the same sub-thread as log files; when the log information is output to email, run in another sub-thread). In the scheduling thread, enable a timer for each output direction, and after responding each time, the timer gets the log information data from the queue corresponding to the terminal and outputs to the corresponding terminal according to the user configuration.