Configuring Syslog

This document describes the Syslog feature and configuration steps to implement Syslog.

Prerequisites for Configuring Syslog

  • NID must be added to the controller.

  • NID must be accessible from the controller.

Information About Syslog

Syslog is a method to collect messages from devices to a server running a syslog daemon. A syslog service simply accepts messages, and stores them in files or prints them according to a simple configuration file. This form of logging is the best available for Cisco devices because it can provide protected long-term storage for logs. This is useful both in routine troubleshooting and in incident handling.

Enabling Syslog

     Command or ActionPurpose
    Step 1 configure terminal


    Example:
    Switch# configure terminal
     

    Enters global configuration mode.

     
    Step 2controller nid 1 NID_ID


    Example:
    Switch(config)# contoller nid 1/2
     

    Enters the controller configuration mode.

     
    Step 3sysLog


    Example:
    Switch(config-controller)# sysLog
     
    Enters the sysLog mode.  
    Step 4setSyslogProperties sysLogConf {valid | logServer {valid | host {hostname | ipv4address}} | level {info | error | warning}} {enable | disable}


    Example:
    Switch(config-controller-sysLog)# setSyslogProperties sysLogConf valid enable
    Switch(config-controller-sysLog)# setSyslogProperties sysLogConf level info 
    Switch(config-controller-sysLog)# setSyslogProperties sysLogConf logServer valid enable
    Switch(config-controller-sysLog)# setSyslogProperties sysLogConf logServer host ipv4address 10.78.101.221
     
    Configures syslog properties.
    • sysLogConf—Sets syslog properties.
    • valid—Enables or disables logging.
    • logServer—Specifies the logging server.
    • valid—Enables or disables logging server.
    • host—Specifies log server name or hostname.
    • hostname—Specifies domain name of the logging server.
    • ipv4address—Specifies IPv4 address of the logging server.
    • level—Specifies the log level.
    • info— Specifies the level information.
    • error— Specifies the level error.
    • warning— Specifies the level warning.
    • enable— Enables configuration of syslog properties.
    • disable— Disables configuration of syslog properties.
     
    Step 5setSyslogProperties review


    Example:
    Switch(config-controller-sysLog)# setSyslogProperties review
     
    Displays the configuration.  
    Step 6setSyslogProperties commit


    Example:
    Switch(config-controller-sysLog)# setSyslogProperties commit
     
    Sends the configuration to NID.  
    Step 7exit


    Example:
    Switch(config-controller-sysLog)# exit
     
    .Exits to the config-controller mode.  

    Configuration Example

    The example shows how to enable syslog:

    Switch(config-controller-sysLog)# setSyslogProperties sysLogConf valid enable 
    Switch(config-controller-sysLog)# setSyslogProperties sysLogConf level info 
    Switch(config-controller-sysLog)# setSyslogProperties sysLogConf logServer valid enable 
    Switch(config-controller-sysLog)# setSyslogProperties sysLogConf logServer host ipv4address 10.78.101.221 
    
    Switch(config-controller-sysLog)# setSyslogProperties review
    Switch(config-controller-sysLog)# setSyslogProperties commit
    Switch(config-controller-sysLog)# exit

    Clearing Syslog

       Command or ActionPurpose
      Step 1 configure terminal


      Example:
      Switch# configure terminal
       

      Enters global configuration mode.

       
      Step 2controller nid 1 NID_ID


      Example:
      Switch(config)# contoller nid 1/2
       

      Enters the controller configuration mode.

       
      Step 3sysLog


      Example:
      Switch(config-controller)# sysLog
       
      Enters the sysLog mode.  
      Step 4clearSysLog clearLogLevelConf {error | info | warning} {enable | disable}


      Example:
      Switch(config-controller-sysLog)# clearSysLog clearLogLevelConf info enable
      
       
      Clears system log information.
      • clearLogLevelConf—Clears log information.
      • error—Specifies level error.
      • info—Specifies level information.
      • warning—Specifies level warning.
      • enable—Enables the clearing of log information.
      • disable—Disables the clearing of log information.
       
      Step 5clearSysLog review


      Example:
      Switch(config-controller-sysLog)# clearSysLog review
       
      Displays the configuration.  
      Step 6clearSysLog commit


      Example:
      Switch(config-controller-sysLog)# clearSysLog commit
       
      Sends the configuration to NID.  
      Step 7clearSysLog clearLogLevelConf {error | info | warning} {enable | disable}


      Example:
      Switch(config-controller-sysLog)# clearSysLog clearLogLevelConf error enable
      
       
      Clears system log level errors.
      • clearLogLevelConf—Clears log information.
      • error—Specifies level error.
      • info—Specifies level information.
      • warning—Specifies level warning.
      • enable—Enables the clearing of log information.
      • disable—Disables the clearing of log information.
       
      Step 8clearSysLog review


      Example:
      Switch(config-controller-sysLog)# clearSysLog review
       
      Displays the configuration.  
      Step 9clearSysLog commit


      Example:
      Switch(config-controller-sysLog)# clearSysLog commit
       
      Sends the configuration to NID.  
      Step 10clearSysLog clearLogLevelConf {error | info | warning} {enable | disable}


      Example:
      Switch(config-controller-sysLog)# clearSysLog clearLogLevelConf warning enable
       
      Clears system log level warnings.
      • clearLogLevelConf—Clears log information.
      • error—Specifies level error.
      • info—Specifies level information.
      • warning—Specifies level warning.
      • enable—Enables the clearing of log information.
      • disable—Disables the clearing of log information.
       
      Step 11clearSysLog review


      Example:
      Switch(config-controller-sysLog)# clearSysLog review
       
      Displays the configuration.  
      Step 12clearSysLog commit


      Example:
      Switch(config-controller-sysLog)# clearSysLog commit
       
      Sends the configuration to NID.  
      Step 13exit


      Example:
      Switch(config-controller-sysLog)# exit
       
      Exits to the config-controller mode.  

      Configuration Example

      The example shows how to clear syslog:

      Switch(config-controller-sysLog)# clearSysLog clearLogLevelConf info
      Switch(config-controller-sysLog)# clearSysLog review
      Switch(config-controller-sysLog)# clearSysLog commit
      Switch(config-controller-sysLog)# clearSysLog clearLogLevelConf error
      Switch(config-controller-sysLog)# clearSysLog review
      Switch(config-controller-sysLog)# clearSysLog commit
      Switch(config-controller-sysLog)# clearSysLog clearLogLevelConf warning
      Switch(config-controller-sysLog)# clearSysLog review
      Switch(config-controller-sysLog)# clearSysLog commit
      Switch(config-controller-sysLog)# exit

      Verifying Syslog

      Use the following command to verify the syslog status on the controller.

      • showLogLevelConf

        This command displays the syslog configuration status on the NID. The following is a sample output from the command:

        Switch(config-controller-sysLog)# showSysLog showLogLevelConf
        Switch(config-controller-sysLog)# showSysLog review
        Commands in queue:
        	showSysLog showLogLevelConf
        Switch(config-controller-sysLog)# showSysLog commit
        Clearing Socket 0 Clearing Socket 0 
        ShowSysLog_Output.showLogLevelResponse.hostMode = true
        ShowSysLog_Output.showLogLevelResponse.hostAddress = '10.78.101.221'
        ShowSysLog_Output.showLogLevelResponse.logLevel = 'info'
        ShowSysLog_Output.showLogLevelResponse.noOfLogEntries.InfoCounter = 40
        ShowSysLog_Output.showLogLevelResponse.noOfLogEntries.warningCounter = 0
        ShowSysLog_Output.showLogLevelResponse.noOfLogEntries.errorCounter = 0
        
         ShowSysLog Commit Success!!!