Configuring the minimum severity of messages sent to syslog servers using the CLI

Prev Next

This topic describes how to use CLI commands to specify the minimum severity level of log messages sent to syslog servers. For a full list of logging commands and the usage and parameters, see the CLI Command Reference.

Prerequisites
  • Admin access

To configure the minimum severity of log messages sent to syslog servers:
  1. Go to CLI configuration mode:

    hostname > enable
    hostname # configure terminal
  2. To specify the minimum severity level of messages sent to syslog servers, use the logging trap <severity> command, where <severity> is one of the following:

    • none—Disables logging.

    • emerg—System failure.

    • alert—Immediate action required.

    • crit—Critical condition.

    • err—Error condition.

    • warning—Warning condition.

    • notice—Normal but significant condition.

    • info—Informational message.

    • debug—Debug-level message.

    The following example specifies that all log messages of error level or higher severity are sent to the syslog server:

    hostname (config) # logging trap err
  3. Verify your changes:

    hostname (config) # show logging
    Local logging level:                   notice
       Override for class mgmt-back:       notice
       Override for class mgmt-front:      notice 
       Override for class mail:            none
    Remote syslog default level:           err
    Remote syslog servers:
       10.10.20.62err
          protocol:                        udp
          port:                            514
    [ . . . ]
  4. Save your changes.

    hostname (config) # write memory