The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
This chapter describes how to configure system message logging on the Cisco 1000 Series Connected Grid Routers (hereafter referred to as Cisco CG-OS router).
System message logging allows you to configure the destination device of the system messages and to filter system messages by severity level. System messages can be logged to terminal sessions, a log file, and to syslog servers on remote systems. System message logging is based on RFC5424 .
Table 2-1 describes the severity levels used in system messages. When you configure the severity level, the system outputs messages at that level and lower.
For example, when security level 4 is configured on the Cisco CG-OS router, the router logs all messages for security levels 1, 2, 3, and 4.
The Cisco CG-OS router logs the most recent 100 messages of severity 0, 1, or 2 to the NVRAM log. You cannot configure logging to the NVRAM.
You can configure which system messages to log based on the facility that generated the message and its severity level. For information about configuring the severity level by module and facility, see Configuring Parameters for Module and Facility Messages Logs.
The syslog servers run on remote systems that log system messages based on the syslog protocol. You can configure up to eight IPv4 or IPv6 syslog servers. For information about configuring syslog servers, see Configuring syslog Servers.
Note When the Cisco CG-OS router first initializes, the Cisco CG-OS software sends messages to syslog servers only after the network initializes.
Identify the local or remote device that you want on which you want to log the system messages.
Identify what severity level filtering of system messages, if any, you want to configure on the
Cisco CG-OS router.
This section includes the following topics:
You can configure the Cisco CG-OS router to log messages by their severity level to console, Telnet, and SSHv2 sessions.
By default, logging is enabled for terminal sessions.
Tip The current critical (default) logging level is maintained if the console baud speed is 9600 baud (default). All attempts to change the console logging level generate an error message. To increase the logging level (above critical), you must change the console baud speed to 38400 baud.
Enables the Cisco CG-OS router to log messages to the console. |
||
Configures the Cisco CG-OS router to log messages to the console session based on the defined severity level as well as those security levels with higher numbers. For example, when security level 4 is configured on the Cisco CG-OS router, the router logs all messages for security levels 1, 2, 3, and 4. Severity levels range from 1 to 7 (see Table 2-1). |
||
Disables the ability of the Cisco CG-OS router to log messages to the console. |
||
Enables the Cisco CG-OS router to log messages to the monitor based on the specified severity level and higher. For example, when security level 4 is configured on the Cisco CG-OS router, the router logs all messages for security levels 1, 2, 3, and 4. The configuration applies to Telnet and SSHv2 sessions. Severity level settings range from 0 to 7 (see Table 2-1 ). |
||
(Optional) Copies the running configuration to the startup configuration. |
This example shows how to log messages by their severity level to a console and monitor (Telnet and SSHv2).
You can configure the Cisco CG-OS router to log system messages to a file. By default, system messages are logged to the file log: messages.
For information about displaying and clearing log files, see Displaying and Clearing Log Files.
Configures the name of the log file that stores system messages and the minimum severity level to log. Severity levels are listed in Table 2-1 . (Optional) You can also specify a maximum file size. Severity levels are listed in Table 2-1 . The file size is from 4096 to 10485760 bytes. The default severity level is 5 and the file size is 10485760. |
||
no logging logfile [ logfile-name severity-level [ size bytes ]] |
||
logging event {link-status | trunk-status} {enable | default} |
link-status —Logs all UP/DOWN and CHANGE messages. enable —Enables logging on the interface. default —Enables the default logging configuration on interfaces that are not implicitly configured (see Table 2-2 ). |
|
(Optional) Copies the running configuration to the startup configuration. |
You can configure the severity level and time-stamp units of messages logged by module and facility.
Note All module commands refer to configuration of interface (Ethernet, cellular, WiMax) logging. In some cases, the Cisco CG-OS software might refer to interfaces as line cards.
Enables module log messages that have the specified severity level or higher. For example, when security level 4 is configured on the Cisco CG-OS router, the router logs all messages for security levels 1, 2, 3, and 4. Severity levels, which range from 0 to 7, are listed in Table 2-1 . |
||
Enables logging messages from the specified facility that have the specified severity level or higher. Severity levels, which range from 0 to 7, are listed in Table 2-1 . To apply the same severity level to all facilities, use the all facility. For defaults, see the show logging level command. |
||
Resets the logging severity level for the specified facility to its default level. When you do not specify a facility and severity level, the Cisco CG-OS router resets all facilities to their default levels. |
||
(Optional) Displays the logging level configuration and the system default level by facility. When you do not specify a facility, the Cisco CG-OS router displays levels for all facilities. |
||
Sets the logging time-stamp units. By default, the units are seconds. Note : This command applies to logs that the Cisco CG-OS router stores locally. It does not apply to the external logging server. |
||
no logging timestamp { microseconds | milliseconds | seconds } |
Resets the logging time-stamp units to the default of seconds. Note : This command applies to logs that the Cisco CG-OS router stores locally. It does not apply to the external logging server. |
|
(Optional) Displays the logging time-stamp units configured. |
||
(Optional) Copies the running configuration to the startup configuration. |
This example shows how to configure the severity level and time-stamp units of messages logged by modules and facilities.
You can configure up to eight syslog servers that reference remote systems to log system messages.
logging server { hostname | ipv4_address | ipv6_address} [ severity-level] |
Configures a syslog server by its specified hostname or IPv4 or IPv6 address. Severity levels, which range from 0 to 7, are listed in Table 2-1 . The default outgoing facility is local 7. |
|
Enables a source interface for the remote syslog server, which in this case is the loopback interface. The range for the virtual-interface argument is from 0 to 1023. |
||
(Optional) Copies the running configuration to the startup configuration. |
This example shows how to a configure syslog server with an IPv4 address.
This example shows how to configure a syslog server with an IPv6 address.
Configuring Syslog Server on UNIX or Linux
You can configure a syslog server on a UNIX or Linux system by adding the following line to the /etc/syslog.conf file:
Table 2-3 describes the syslog fields that you can configure.
To configure a syslog server on a UNIX or Linux system, follow these steps:
Step 1 Log debug messages with the local7 facility in the file /var/log/myfile.log by adding the following line to the /etc/syslog.conf file:
Step 2 Create the log file by entering these commands at the shell prompt:
Step 3 Make sure the system message logging daemon reads the new changes by checking myfile.log after entering this command:
You can display or clear messages in the log file and the NVRAM.
To display system message logging configuration information, enter any of all of the following commands.
For detailed information about the fields in the output from these commands, see the Command Lookup Tool on Cisco.com.