logging

Syntax

logging {||} [udp [] | tcp []] [include-auditable-events][严重性] [vrf]
no logging {||} [udp [] | tcp []] [severity] [vrf]
no logging

Description

Enables syslog forwarding to a remote syslog server.

Thenoform of this command disables syslog forwarding to a remote syslog server.

Command context

config

Parameters

{||}
Selects the IPv4 address, IPv6 address, or host name of the remote syslog server. Required.
[udp [] | tcp []]

Specifies the UDP port or TCP port of the remote syslog server to receive the forwarded syslog messages.

udp []

Range: 1 to 65535. Default: 514

tcp []

Range: 1 to 65535. Default: 1470

include-auditable-events

Specifies that auditable messages are also logged to the remote syslog server.

severity
Specifies the severity of the syslog messages:
  • alert: Forwards syslog messages with the severity ofalert (6)andemergency (7).

  • crit: Forwards syslog messages with the severity ofcritical (5)及以上.

  • debug: Forwards syslog messages with the severity ofdebug (0)及以上.

  • emerg: Forwards syslog messages with the severity ofemergency (7)only.

  • err: Forwards syslog messages with the severity oferr (4)及以上

  • info: Forwards syslog messages with the severity ofinfo (1)及以上. Default.

  • notice: Forwards syslog messages with the severity ofnotice (2)及以上.

  • warning: Forwards syslog messages with the severity ofwarning (3)及以上.

vrf

Specifies the VRF used to connect to the syslog server. Optional. Default:default

Authority

Administrators or local user group members with execution rights for this command.

Examples

Enabling the syslog forwarding to remote syslog server 10.0.10.2:

switch(config)#logging 10.0.10.2

Enabling the syslog forwarding of messages with a severity oferr (4)及以上to TCP port 4242 on remote syslog server 10.0.10.9 with VRFlab_vrf:

switch(config)#logging 10.0.10.9 tcp 4242 severity err vrf lab_vrf

Disabling syslog forwarding to a remote syslog server:

switch(config)#no logging