Configuring FlexSwitch Logging

FlexSwitch provide a logging facility consistent with RFC 5424.

Logging Levels

Note

The default level for all components is err.

Severity Description
crit Critical conditions, such as hard device errors.
err Error conditions
warn Warning Conditions
alert Action must be taken immediately. <.br>A condition that should be corrected immediately, such as a corrupted system database.
emer System is unusable. A panic condition.
notice Normal but significant conditions.
Conditions that are not error conditions, but that may require special handling.
info Informational messages.
debug Debug-level messages.
Messages that contain information normally of use only when debugging a program.
trace
off Turn off logging for this component.

Components

FlexSwtich provides logging for the following components:

  • arpd
  • asicd
  • fMgrd
  • lacpd
  • lldpd
  • ribd
  • statsd
  • stpd
  • sysmgmtd

Using the CLI to Configure Component Logging

Configure a Component Logging Level

Use the logging context commands as shown below to configure a logging level.

In the following example we set the aprd component logging level to warn.

localhost(config)#logging component arpd
localhost(config-log-comp-arpd)#level warn

Confirm the Configuration Information

Confirm the pending configuration before applying it.

localhost(config-log-comp-arpd)#showunapplied 
Pending Config
NOTE: If attribute is not user provisioned default values shown, when config is applied a
read before write action will occur to fill in values of attributes not set by user.

id: 1   object: ComponentLogging   status: PENDING CONFIG  valid: True delete: False num user cmds: 2
 command                   attr         value    model attr    iskey    required    userprov    time provisioned         
-------------------------------------------------------------------------------------------------------------------------
 logging component arpd    component    arpd     Module        True     X           X           Thu Aug  3 19:04:07 2017 
 level warn                level        warn     Level         False                X           Thu Aug  3 19:04:13 2017 

Apply the Configuration

localhost(config-log-comp-arpd)#apply
Applying Config:
id: 1   object: ComponentLogging   status: APPLIED CONFIG  valid: True delete: False num user cmds: 2
 command                   attr         value    model attr    iskey    required    userprov    time provisioned         
-------------------------------------------------------------------------------------------------------------------------
 logging component arpd    component    arpd     Module        True     X           X           Thu Aug  3 19:04:07 2017 
 level warn                level        warn     Level         False                X           Thu Aug  3 19:04:13 2017 

sdk:updateComponentLogging(arpd,Level=warn) result: SUCCESS: http status code: 200

Verify the Configuration

Use the show run command to see the component logging configuration.

localhost(config)#show run
printing without defaults
!
user admin
   Access Sudo
!
logging component arpd
   level warn
!
logging component asicd
   level err
!
logging component confd
   level err
!
logging component fMgrd
   level err
!
logging component lacpd
   level err
!
logging component lldpd
   level err
!
logging component notifierd
   level err
!
logging component platformd
   level err
!
logging component pmd
   level err
!
logging component ribd
   level err
!
logging component statsd
   level err
!
logging component stpd
   level err
!
logging component sysmgmtd
   level err

Using the REST (cURL) Interface to Configure Logging Levels

Configuring a Logging Level

In the following example we set the logging level for the ribd object to warn using the REST PATCH method to update the ComponentLogging object.

 localhost$ curl -k -u <username>:<password> -X PATCH -H "Content-Type: application/json" -d '{"Module":"ribd","Level":"warn"}' https://192.168.100.91:443/public/v1/config/ComponentLogging | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   316  100   284  100    32   1155    130 --:--:-- --:--:-- --:--:--  1159
{
    "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept",
    "Access-Control-Allow-Methods": "POST, GET, OPTIONS, PATCH, DELETE",
    "Access-Control-Allow-Origin": "*",
    "Access-Control-Max_age": "86400",
    "ObjectId": "3d302d9a-688a-4a35-4ad9-19706475c962",
    "Result": "Success"
}

Verify the Configuration

In the following example we use the REST GET (all) request to see the new configuration.

localhost$ curl -X GET -k -u <username>:<password> https://192.168.100.91:443/public/v1/config/ComponentLoggings | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1309  100  1309    0     0   4812      0 --:--:-- --:--:-- --:--:--  4830
{
    "CurrentMarker": 0,
    "MoreExist": false,
    "NextMarker": 0,
    "ObjCount": 13,
    "Objects": [
        {
            "Object": {
                "Level": "warn",
                "Module": "arpd"
            },
            "ObjectId": "303c25ce-57ed-40f0-57db-5c68491b9861"
        },
        {
            "Object": {
                "Level": "err",
                "Module": "asicd"
            },
            "ObjectId": "c5f19712-21f7-44d1-4640-821a016e891a"
        },
        {
            "Object": {
                "Level": "err",
                "Module": "confd"
            },
            "ObjectId": "6955d454-b939-4bfa-684c-39f33c11f20e"
        },
        {
            "Object": {
                "Level": "err",
                "Module": "fMgrd"
            },
            "ObjectId": "315cd0bd-5b0a-4354-5593-5d4913b8fa70"
        },
        {
            "Object": {
                "Level": "err",
                "Module": "lacpd"
            },
            "ObjectId": "7522ca84-79ba-4a27-662c-edad79c4552f"
        },
        {
            "Object": {
                "Level": "err",
                "Module": "lldpd"
            },
            "ObjectId": "ba64d125-4f83-4a1a-59ae-71582a86b877"
        },
        {
            "Object": {
                "Level": "err",
                "Module": "notifierd"
            },
            "ObjectId": "9b8f7652-9990-4644-5865-a50291b530ac"
        },
        {
            "Object": {
                "Level": "err",
                "Module": "platformd"
            },
            "ObjectId": "37d21369-d4ce-4123-5cca-eba6ed79a0f2"
        },
        {
            "Object": {
                "Level": "err",
                "Module": "pmd"
            },
            "ObjectId": "effaa8da-3fd4-4001-55a0-f27e3289d8e4"
        },
        {
            "Object": {
                "Level": "warn",
                "Module": "ribd"
            },
            "ObjectId": "3d302d9a-688a-4a35-4ad9-19706475c962"
        },
        {
            "Object": {
                "Level": "err",
                "Module": "statsd"
            },
            "ObjectId": "3376c2ce-2543-48ba-4f7a-bb867fd86fdf"
        },
        {
            "Object": {
                "Level": "err",
                "Module": "stpd"
            },
            "ObjectId": "c84ddf09-906c-4a4f-577e-ccb3dbd6c3ad"
        },
        {
            "Object": {
                "Level": "err",
                "Module": "sysmgmtd"
            },
            "ObjectId": "3e4a8280-45e9-4315-6b1d-37ea542191ef"
        }
    ]
}