System Log Commands

Use these M4500 CLI commands to configure buffered, console, and syslog host logging, set severity levels, and display logging settings and trap logs.

show logging

This command displays configurations of logging application.

Default None
Format show logging
Mode Privileged Exec

Example:

CODE
(M4500-32C) #show logging

Logging Client Local Port           : 514
Logging Client Source Interface     : (not configured)
CLI Command Logging                 : disabled
Console Logging                     : enabled
Console Logging Severity Filter     : error
Buffered Logging                    : enabled
Buffered Logging Severity Filter    : info
Persistent Logging                  : disabled
Persistent Logging Severity Filter  : alert

Syslog Logging                      : disabled
Syslog Logging Facility             : user

Terminal Monitor                    : disabled
Terminal Logging Severity Filter    : warning

Log Messages Received               : 139
Log Messages Dropped                : 0
Log Messages Relayed                : 0

Log Command Messages Received       : 2

(M4500-32C) #

show logging buffered

This command displays the log messages which record system operating and tracing information. The log buffered messages store in memory, therefore, it isn’t retained across a switch reset.

Default None
Format show logging buffered
Mode Privileged Exec

Example:

PYTHON
(M4500-32C) #show logging buffered

Buffered (In-Memory) Logging        : enabled
Buffered Logging Wrapping Behavior  : On
Buffered Log Count                  : 33

Apr 28 19:35:09: %1-6-NIM: [396203556] nim_rif.c(352) 117 %% Set expandable port 0/50 count
set to 1
Apr 28 19:35:09: %1-6-NIM: [396203556] nim_rif.c(352) 116 %% Set expandable port 0/49 count
set to 1
Apr 28 19:35:05: %1-5-TRAPMGR: [397164180] traputil.c(797) 115 %% Temperature state change
alarm: Unit Number: 1 Current: Normal, Previous: None
Apr 28 19:34:59: %1-5-TRAPMGR: [396792620] traputil.c(755) 114 %% Succeeded User Login:
Console started for user admin connected from EIA-232.
Apr 28 19:34:57: %1-5-TRAPMGR: [396792620] traputil.c(755) 113 %% Entity Database:
Configuration Changed
Apr 28 19:34:52: %1-2-General: [1212183788] Boot!(0) 112 %% Event(0xaaaaaaaa)
Apr 28 19:34:52: %1-6-AUTO_INST: [1212183788] auto_install_control.c(1374) 111 %% AutoInstall
is stopped.
Apr 28 19:34:52: %1-5-SIM: [1212183788] sim_util.c(3841) 110 %% Switch firmware operational:
LY8, Runtime Code 5.4.01.10, Linux 3.8.13-rt9, U-Boot 2010.12 (Oct 03 2014 - 14:38:07) - ONIE
2014.05.03-7
Apr 28 19:34:52: %1-5-TRAPMGR: [396792620] traputil.c(755) 109 %% Link Down: VLAN- 1
Apr 28 19:34:52: %1-5-SIM: [1212183788] sim_svc_port.c(334) 108 %% Service port IPv4 address
has been set to 192.168.2.10.
Apr 28 19:34:52: %1-5-SIM: [1212183788] sim_svc_port.c(334) 107 %% Service port IPv4 address
has been set to 0.0.0.0.
Apr 28 19:34:52: %1-6-CLI_WEB: [1212183788] sysapi.c(2844) 106 %% Configuration file
<startup-config> read from flash!
Apr 28 19:34:51: %1-5-IP: [396819460] openr_policy.c(1438) 99 %% Added RPPI routing policy
client ospf:0.
Apr 28 19:34:51: %1-6-CLI_WEB: [1212183788] cli_txtcfg.c(542) 98 %% Configuration applied
from file <startup-config>
Apr 28 19:34:51: %1-6-CLI_WEB: [1212183788] sysapi.c(2844) 97 %% Configuration file <startup-
config> read from flash!
Apr 28 19:34:50: %1-6-General: [1209039980] procmgr.c(800) 94 %% Application Started
(opensshd, ID = 8, PID = 936
Apr 28 19:34:50: %1-5-General: [1209039980] procmgr.c(2436) 93 %% Administrative Command:app-
start opensshd
Apr 28 11:34:49: %1-6-DOT3AD: [396784740] dot3ad_cnfgr.c(1192) 20 %% Tech Support
Registration failed for DOT3AD related commands
Apr 28 11:34:45: %1-6-General: [1209039980] procmgr.c(800) 19 %% Application Started
(traceroute-0, ID = 12, PID = 916
Apr 28 11:34:45: %1-5-General: [1209039980] procmgr.c(2436) 18 %% Administrative Command:app-
start traceroute-0
Apr 28 11:34:45: %1-6-General: [1209039980] procmgr.c(800) 17 %% Application Started (ping-0,
ID = 11, PID = 909
Apr 28 11:34:45: %1-5-General: [1209039980] procmgr.c(2436) 16 %% Administrative Command:app-
start ping-0
Apr 28 11:34:44: %1-5-OSAPI: [1289614252] osapi_monitor.c(145) 15 %% Watchdog timer is
started.
Apr 28 11:34:44: %1-6-General: [1209039980] procmgr.c(800) 14 %% Application Started (ospf-
00, ID = 10, PID = 851
Apr 28 11:34:44: %1-5-General: [1209039980] procmgr.c(2436) 13 %% Administrative Command:app-
start ospf-00 0
Apr 28 11:34:44: %1-6-General: [1209039980] procmgr.c(800) 12 %% Application Started (vr-
agent-0, ID = 9, PID = 845
Apr 28 11:34:44: %1-5-General: [1209039980] procmgr.c(2436) 10 %% Administrative Command:app-
start vr-agent-0
Apr 28 11:34:44: %1-6-VR_AGENT: [1289691836] vr_agent_api.c(73) 7 %% initialized the clnt
addr:/tmp/fpcvragent.00,family:1
Apr 28 11:34:43: %1-1-SIM: [1289691836] sim_util.c(3877) 5 %% Switch was reset due to
operator intervention.
Apr 28 11:34:43: %1-5-BSP: [396148460] bootos.c(178) 4 %% BSP initialization complete,
starting switch firmware.
Apr 28 11:34:35: %1-5-General: [396148460] sdm_template_mgr.c(494) 3 %% Booting with default
SDM template Data Center - IPv4 and IPv6.
Apr 28 11:34:34: %1-6-General: [1209039980] procmgr.c(3677) 2 %% Application Terminated
(user.start, ID = 7, PID = 686
Apr 28 11:34:33: %1-1-General: [396148460] usmdb_sim.c(3921) 1 %% Reboot 1 (0x1)

(M4500-32C) #

logging buffered

This command is used to enable or disable logging to the in-memory log. If the log buffer is full, the log wrap around.

Default Enabled
Format [no] logging buffered
Mode Global Config

logging buffered threshold

This command is used to configure the threshold of the logging buffer. The range of the threshold is from 1 to 100 percent. The threshold mode and wraparound mode are mutually exclusive. When you configure the threshold, logs do not wrap around. When you set a threshold value, the switch sends an alert when the threshold is exceeded. When the maximum capacity of the log is reached, logging stops. If you configured an email alert for this event, the switch sends an email.

Default 100
Format [no] logging buffered threshold <1-100>
Mode Global Config

logging buffered severity level

This command sets logging severity level. The logging buffered only records the messages which of level is equal or above severity level.

The parameters “severitylevel” could be specified as either an integer from 0 to 7 or symbolically through one of the following keywords: emergency (0), alert (1), critical (2), error (3), warning (4), notice (5), informational (6), debug (7).

Default Info
Format logging buffered [<severitylevel keyword> | <0 ~ 7>]
Mode Global Config

In the following two examples, the severity level is set the warning level.

CODE
(M4500-32C) #logging buffered 4
(M4500-32C) #logging buffered warning

logging buffered wrap

This command enables wrapping of in-memory logging, it will overwrite old log records when full capacity reached. Otherwise when full capacity is reached, logging stops.

Default Enabled
Format [no] logging buffered wrap
Mode Global Config

clear logging buffered

This command clears all in-memory logs.

Default None
Format clear logging buffered
Mode Privilege EXEC

show logging traplogs

This command displays the trap log maintained by the switch. Trap log is not retained across a switch reset.

Default None
Format show logging traplogs
Mode Privileged Exec

Example:

PYTHON
(M4500-32C) #show logging traplogs

Number of Traps Since Last Reset............... 5
Trap Log Capacity.............................. 256
Number of Traps Since Log Last Viewed.......... 5

Log System Up Time           Trap
--- ------------------------ -------------------------------------------------
  0 Apr 28 19:35:51 2000     Cold Start: Unit: 0
  1 Apr 28 19:35:05 2000     Temperature state change alarm: Unit Number: 1
                             Current: Normal, Previous: None
  2 Apr 28 19:34:59 2000     Succeeded User Login: Console started for user
                             admin connected from EIA-232.
  3 Apr 28 19:34:57 2000     Entity Database: Configuration Changed
  4 Apr 28 19:34:52 2000     Link Down: VLAN- 1
(M4500-32C) #

show logging hosts

This command displays the configuration of logging hosts.

Default None
Format show logging hosts
Mode Privileged Exec

Example:

CODE
(M4500-32C) #show logging hosts

Index   IP Address/Hostname      Type        Severity    Port     Status
-----  ------------------------ ----------  ----------  ------ -------------
1     10.1.1.100                 ipv4        critical   514    Active
2     logging-server.test.dep    dns         critical   514    Active

(M4500-32C) #

logging host

This command is used to add addresses of remote log hosts.

The parameter “<hostaddress|hostname>” could be IPv4 address, or IPv6 address, or domain name. This parameter needs to match next parameter {dns | ipv4 | ipv6} to clarify its format.

The parameter “<port>” means the service port number of remote log host.

The parameters “severitylevel” could be specified as either an integer from 0 to 7 or symbolically through one of the following keywords: emergency (0), alert (1), critical (2), error (3), warning (4), notice (5), informational (6), debug (7).

Default

<port> is 514

<severitylevel> is critical

Format logging host <hostaddress|hostname> {dns | ipv4 | ipv6} [<port>] [<severitylevel>]
Mode Global Config

Example: Adds two logging hosts: first one uses the format of IPv4 address, default port and, default severity level; second one uses the format of domain name, assigns server port to 514 and severity level to critical (2).

CODE
(M4500-32C) #configure
(M4500-32C) (Config)#logging host 10.1.1.100 ipv4
(M4500-32C) (Config)#logging host logging-server.test.dep dns 514 2

logging host remove

This command is used to remove a remote log host.

The parameter “<hostindex>” means logging host Index which could be found in the output of “show logging hosts".

Default None
Format logging host remove <hostindex>
Mode Global Config

Example: Remove an existing log host which of index is 1.

(M4500-32C) #configure

(M4500-32C) (Config)#logging host remove 1

logging host reconfigure

This command is used to reconfigure the setting of existing log host.

The parameter “<hostindex>” means logging host Index which could be found in the output of “show logging hosts".

The parameter “<hostaddress|hostname>” could be IPv4 address, or IPv6 address, or domain name.

The parameter “<port>” means the service port number of remote log host.

The parameters “severitylevel” could be specified as either an integer from 0 to 7 or symbolically through one of the following keywords: emergency (0), alert (1), critical (2), error (3), warning (4), notice (5), informational (6), debug (7).

Default None
Format logging host reconfigure <hostindex> {<hostaddress|hostname> | port <port> | severitylevel <severitylevel>}
Mode Global Config

Example: Changes the address of index 1 logging host to IPv4 address 2.2.2.2.

CODE
(M4500-32C) #configure
(M4500-32C) (Config)# logging host reconfigure 1 2.2.2.2

logging syslog

This command enables or disables syslog logging.

Default Disabled
Format [no] logging syslog
Mode Global Config

logging syslog port

This command sets the local port number of the log client for logging messages.

Default 514
Format [no] logging syslog port <portid>
Mode Global Config

logging syslog facility

This command sets the default facility used in syslog messages for components that do not have an internally assigned facility.

The parameter “<facility>” can be one of the following keywords: kernel, user, mail, system, security, syslog, lpr, nntp, uucp, cron, auth, ftp, ntp, audit, alert, clock, local0, local1, local2, local3, local4, local5, local6, local7, all.

Default user
Format logging syslog facility <facility>
Mode Global Config

logging syslog source-interface

This command is used to specify the physical or logical interface to use as the Syslog client source interface. If configured, the address of source interface is used for all Syslog communications between the Syslog server and the Syslog client. Otherwise there is no change in behavior. If the configured interface is down, the Syslog client falls back to normal behavior.

Default not configure
Format

logging syslog source-interface {<slot/port> | loopback <loopback-id> | serviceport | tunnel <tunnel-id> | vlan <vlan-id>}

no logging syslog source-interface

Mode Global Config

logging console

This command enables or disables to print log message to console.

Default Enabled
Format [no] logging console
Mode Global Config

logging console severity level

This command sets the severity level of logging console. The logging console only prints the messages which of level is equal or above severity level.

The parameters “severitylevel” could be specified as either an integer from 0 to 7 or symbolically through one of the following keywords: emergency (0), alert (1), critical (2), error (3), warning (4), notice (5), informational (6), debug (7).

Default Info
Format logging console [<severitylevel keyword> | <0 ~ 7>]
Mode Global Config

Example: Below two examples are some configurations, it sets severity level of logging console to warning.

CODE
(M4500-32C) #logging console 4
(M4500-32C) #logging console warning

logging monitor

This command is used to enable or disable global configuration of terminal monitor. When logging monitor is enabled and terminal session (e.g. Telnet or SSH session) enables configuration of “terminal monitor”, the log messages will print to terminal session.

Default Disabled
Format [no] logging monitor
Mode Global Config

logging monitory severity level

This command sets the severity level of logging monitor. The logging monitor only prints the messages which of level is equal or above severity level.

The parameters “severitylevel” could be specified as either an integer from 0 to 7 or symbolically through one of the following keywords: emergency (0), alert (1), critical (2), error (3), warning (4), notice (5), informational (6), debug (7).

Default Info
Format logging monitor [<severitylevel keyword> | <0 ~ 7>]
Mode Global Config

Example: Below two examples are some configurations, it sets severity level of logging monitor to warning.

CODE
(M4500-32C) #logging monitor 4
(M4500-32C) #logging monitor warning

show logging cli-command-log

This command displays the logging configuration and the received cli command messages.

The log may not show in time order since the switch only keeps the last 5000 logs in file and the new log entries overwrite the old ones when the logs number is more than 5000.

Default None
Format show logging cli-command-log
Mode Privileged Exec

Example:

CODE
(M4500-32C) #show logging cli-command-log
CLI Command Logging                 : enabled
CLI Command Log Maximum             : 5000
CLI Command Log Current Count       : 8
Jun 22 18:44:26: %Switch-1-LOG: [0xf7800754] 1 %% CLI:EIA-232:admin:clear cli-
command-log
Jun 22 18:50:15: %Switch-1-LOG: [0xdf956804] 2 %% CLI:EIA-232:admin:Disconnected
due to Idle Timeout
Jun 22 18:57:18: %Switch-1-LOG: [0xf7800754] 3 %% CLI:EIA-232:admin:User admin
logged in
Jun 22 19:05:36: %Switch-1-LOG: [0xf7800754] 4 %% CLI:EIA-232:admin:show logging
cli-command-log
Jun 22 19:06:28: %Switch-1-LOG: [0xf7800754] 5 %% CLI:EIA-232:admin:configure
Jun 22 19:06:34: %DUT-1-LOG: [0xf7800754] 6 %% CLI:EIA-232:admin:hostname DUT
Jun 22 19:06:40: %DUT-1-LOG: [0xf7800754] 7 %% CLI:EIA-232:admin:hostname DUT
Jun 22 19:06:59: %Test-1-LOG: [0xf7800754] 8 %% CLI:EIA-232:admin:hostname Test
(M4500-32C) #

logging cli-command

This command is used to enable or disable system logs the cli-command history to a file in global configuration mode.

The switch supports up to 5000 entries in the CLI command history log. If the logs are more than 5000 entries, the switch removes the oldest log and writes the new entry. All the entries have the time stamp for reference.

Default Enabled
Format [no] logging cli-command
Mode Global Config

clear cli-command-log

This command is used to reset the CLI command log file and the count of received commands.

The switch clears and resets the CLI command history log through the use of this command. Whether or not the CLI logging command function is enabled, you can clear the history log file.

Default None
Format clear cli-command-log
Mode Privileged Exec