Logging Commands

Use these commands to configure system logging, and to view logs and the logging settings.

logging buffered

M4250

M4350

This command enables logging to an in-memory log. You can specify the severity level value 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), info (6), or debug (7).

Default disabled; notice (5) when enabled
Format logging buffered [severitylevel]
Mode Global Config

no logging buffered

This command disables logging to in-memory log.

Format no logging buffered
Mode Global Config

logging buffered wrap

M4250

M4350

This command enables wrapping of in-memory logging when the log file reaches full capacity. Otherwise when the log file reaches full capacity, logging stops.

Default enabled
Format logging buffered wrap
Mode Privileged EXEC

no logging buffered wrap

This command disables wrapping of in-memory logging and configures logging to stop when the log file capacity is full.

Format no logging buffered wrap
Mode Privileged EXEC

logging buffered threshold

M4250

M4350

This command sets the percentage (from 1 to 100 percent) of log space. If logging exceeds the threshold percentage, a console log is generated, and, if configured, an alert email is generated.

The threshold configuration applies only if the logging buffered wrap command is disabled. The default action for the memory log is to wrap. The threshold does not apply to that default action.

Default enabled
Format logging buffered threshold percentage-range
Mode Global Config
Parameter Definition
percentage-range Sets the percentage of log space that, if exceeded, causes logging to stop. The range is from 1 to 100 percent. The default is 80 percent.

logging cli-command

M4250

M4350

This command enables the CLI command logging feature, which enables the switch to log all CLI commands issued on the switch.

Default enabled
Format logging cli-command
Mode Global Config

no logging cli-command

This command disables the CLI command Logging feature.

Format no logging cli-command
Mode Global Config

logging console

M4250

M4350

This command enables logging to the console. You can specify the severitylevel value 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), info (6), or debug (7).

Default disabled; error (3) when enabled
Format logging console [severitylevel]
Mode Global Config

no logging console

This command disables logging to the console.

Format no logging console
Mode Global Config

logging host

M4250

M4350

This command configures the logging host parameters. You can configure up to eight hosts.

Default
  • port-number. 514
  • severitylevel. 2
Format logging host {hostaddress | hostname} addresstype [tls {anon | x509name certificate-index}] {port-number severitylevel}
Mode Global Config
Parameter Description
hostaddress | hostname The IP address or name of the logging host.
addresstype Indicates the type of address (IPv4, IPv6, or DNS) being passed.
tls [anon | x509name] Enables TLS security for the host through either anon (which stands for anonymous) or x509name, in which you must specify a certificate number.
certificate-index If you select x509name, use the certificate-index argument to specify the certificate number that must be used for authentication. The valid range is from 0 to 8. Use 0 for the default file.
port-number A port number from 1 to 65535.
severitylevel Specify this value 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), info (6), or debug (7).

Command example:

CODE
(NETGEAR Switch) (Config)# logging host google.com dns 214
(NETGEAR Switch) (Config)# logging host 10.130.64.88 ipv4 214 6
(NETGEAR Switch) (Config)# logging host 2000::150 ipv6 214 7

logging host reconfigure

M4250

M4350

This command enables logging host reconfiguration.

Format logging host reconfigure hostindex
Mode Global Config
Parameter Description
hostindex Enter the Logging Host Index for which to change the IP address.

logging host remove

M4250

M4350

This command disables logging to host. See show logging hosts for a list of host indexes.

Format logging host remove hostindex
Mode Global Config

logging protocol

M4250

M4350

This command configures the logging protocol version number as 0 or 1. RFC 3164 uses version 0 and RFC 5424 uses version 1.

Default 0
Format logging protocol {0 | 1}
Mode Global Config

logging syslog

M4250

M4350

This command enables syslog logging.

Format logging syslog
Mode Global Config

no logging syslog

This command disables syslog logging.

Format no logging syslog
Mode Global Config

logging syslog port

M4250

M4350

This command enables syslog logging. The portid argument is an integer in the range 1–65535.

Default disabled
Format logging syslog port portid
Mode Global Config

no logging syslog port

This command disables syslog logging.

Format no logging syslog port
Mode Global Config

logging syslog usb

M4250

M4350

For switch models that support a USB port, this command configures a USB device for the storage of syslog messages.

Format logging syslog usb file-name
Mode Global Config

logging syslog source-interface

M4250

M4350

This command configures the syslog source-interface (source IP address) for syslog server configuration. The selected source-interface IP address is used for filling the IP header of management protocol packets. This allows security devices (firewalls) to identify the source packets coming from the specific switch. If a source-interface is not specified, the primary IP address of the originating (outbound) interface is used as the source address.

To specify an actual interface or port, do the following:

  • For an M4250 series switch, use the argument slot/port.
  • For an M4350 series switch, use the argument unit/slot/port, as shown in the command format.
Format logging syslog source-interface {unit/slot/port | {loopback loopback-id} | {vlan vlan-id} | serviceport}
Mode Global Config
Parameter Description

slot/port or

unit/slot/port

The port-based routing interface.
loopback-id The loopback interface is used as the source IP address. The range of the loopback ID is 0 to 7.
vlan-id The VLAN interface is used as the source IP address. The range of the VLAN ID is 1 to 4093.
serviceport The service port IP address is used as the source IP address.

Command example:

CODE
(config)#logging syslog source-interface loopback 0

Command example:

CODE
(config)#logging syslog source-interface 0/4/1

Command example:

CODE
(config)#logging syslog source-interface 1/0/1

no logging syslog source-interface

This command disables syslog logging.

Format no logging syslog source-interface
Mode Global Config

show logging

M4250

M4350

This command displays logging configuration information.

Format show logging
Mode Privileged EXEC
Term Definition
Logging Client Local Port Port on the collector/relay to which syslog messages are sent.
Logging Client USB file name The file name that is used to write the log to the USB device.
Logging Client Source Interface Shows the configured syslog source-interface (source IP address).
CLI Command Logging Shows whether CLI Command logging is enabled.
Console Logging Shows whether console logging is enabled.
Console Logging Severity Filter The minimum severity that is logged to the console log. Messages with an equal or lower numerical severity are logged.
Buffered Logging Shows whether buffered logging is enabled.
Buffered Logging Severity Filter The minimum severity that is logged to the buffered log. Messages with an equal or lower numerical severity are logged.
Buffered Logging Threshold (%) The buffer threshold value, which represents the percentage of the total log buffer. If logging exceeds this value, a console log is generated, and, if configured, an alert email is generated.
Syslog Logging Shows whether syslog logging is enabled.
Log Messages Received Number of messages received by the log process. This includes messages that are dropped or ignored.
Log Messages Dropped Number of messages that could not be processed due to error or lack of resources.
Log Messages Relayed Number of messages sent to the collector/relay.

Command example:

CODE
(NETGEAR Switch) #show logging

Logging Client Local Port           : 514
Logging Client USB File Name        :
Logging Client Source Interface     : vlan 1
Logging Client Source IPv4 Address  : 169.254.100.100        [Up]
CLI Command Logging                 : disabled
Logging protocol                    : 0
Console Logging                     : enabled
Console Logging Severity Filter     : error
Buffered Logging                    : enabled
Buffered Logging Severity Filter    : notice
Buffered Logging Threshold (%)      : 80

Syslog Logging                      : disabled
Log Messages Received               : 39856
Log Messages Dropped                : 0
Log Messages Relayed                : 0

show logging buffered

M4250

M4350

This command displays buffered logging (system startup and system operation logs).

Format show logging buffered
Mode Privileged EXEC
Term Definition
Buffered (In-Memory) Logging Shows whether the In-Memory log is enabled or disabled.
Buffered Logging Wrapping Behavior The behavior of the In Memory log when faced with a log full situation.
Buffered Log Count The count of valid entries in the buffered log.
Buffered Log Threshold (lines) The configured threshold value expressed as the number of log lines.

show logging hosts

M4250

M4350

This command displays all configured logging hosts. Use the “|” character to display the output filter options.

Format show logging hosts
Mode Privileged EXEC
Term Definition
Host Index Used for deleting hosts.
IP Address / Hostname IP address or hostname of the logging host.
Severity Level The minimum severity to log to the specified address. The possible values are emergency (0), alert (1), critical (2), error (3), warning (4), notice (5), info (6), or debug (7).
Port The server port number, which is the port on the local host from which syslog messages are sent.
Status The status of SNMP (Active, Not in Service, or Not Ready).
Mode The type of security: UDP or TLS.
Auth The type of authentication mode: anonymous or x509name.
Cert# The certificate number to be used for authentication. The valid range is from 0 to 8. Index 0 is used for the default file.

Command example:

CODE
(NETGEAR Switch) #show logging hosts

Index  IP Address/Hostname    Severity   Port   Status    Mode  Auth     Cert#
-----  ---------------------  ---------- ------ --------- ----- -------- -----
1      10.130.64.88           critical   514    Active    udp
1      2000::150              critical   514    Active    udp

show logging traplogs

M4250

M4350

This command displays SNMP trap events and statistics.

Format show logging traplogs
Mode Privileged EXEC
Term Definition
Number of Traps Since Last Reset The number of traps since the last boot.
Trap Log Capacity The number of traps the system can retain.
Number of Traps Since Log Last Viewed The number of new traps since the command was last executed.
Log The log number.
System Time Up How long the system had been running at the time the trap was sent.
Trap The text of the trap message.

clear logging buffered

M4250

M4350

This command clears buffered logging (system startup and system operation logs).

Format clear logging buffered
Mode Privileged EXEC

clear eventlog

M4250

M4350

This command clears all event messages that are stored on the switch.

Format clear eventlog
Mode Privileged EXEC