Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
Logging

Logging is a feature that helps in identifying misconfigurations, system failures etc., by logging messages on to the console or syslog server. It is useful for debugging purposes and take appropriate actions based on the messages logged. Logging uses various severity levels to report the condition that has occurred.

Logging OpEN API

This document provides a brief description of the Logging OpEN APIs. The Logging OpEN APIs allow processes outside of the ICOS main process (switchdrvr) access to Logging Management services. It provides the following services:

All 'Set' operations may affect the Switch behavior and configuration.

Example C Application logging_example

Initialization

In the main function, the sample application initializes the OpEN API RPC service by calling openapiClientRegister() and waits for the RPC service in switchdrvr to start. A Client Handle is returned by openapiClientRegister() which is used while invoking the OpEN APIs. The application then exercises the associated OpEN APIs and logs informational and/or error messages on the console. The example application runs to its completion and exits.

logging_example

logging_example.c is a sample application that demonstrates the use of the Logging OpEN APIs. logging_example is started from the command line and has the following usage syntax:

Usage: logging_example <test#> <arg1> <arg2> ...

It exercises all the Logging OpEN APIs with appropriate arguments to manage the Logging component in the ICOS main process (switchdrvr).

Logging CLI/API Cross Reference

CLI Command OpEN API Reference
(Config)#
[no]logging cli-command
openapiCliCmdLoggingModeSet()
openapiCliCmdLoggingModeGet()
(Config)#
logging host {<ipaddress> | <hostname>} {ipv4 | dns | ipv6}
openapiLoggingHostAdd()
openapiLoggingHostIpAddrNextGet()
(Config)#
logging host {<ipaddress> | <hostname>} {ipv4 | dns | ipv6} <port> [<severity-level>]
openapiLoggingHostPortSet()
openapiLoggingHostPortGet()
openapiLoggingHostSeveritySet()
openapiLoggingHostSeverityGet()
(Config)#
[no]logging persistent <severitylevel>
openapiPersistentLoggingModeSet()
openapiPersistentLoggingModeGet()
openapiPersistentLoggingSeverityLevelSet()
openapiPersistentLoggingSeverityLevelGet()
(Config)#
logging host remove <hostindex>
openapiLoggingHostRemove()
(Config)#
[no]logging syslog
openapiSysLogModeSet()
openapiSysLogModeGet()
(Config)#
[no]logging syslog port <port-id>
openapiSysLogPortSet()
openapiSysLogPortGet()
(Config)#
[no]logging console
openapiConsoleLoggingModeSet()
openapiConsoleLoggingModeGet()
(Config)#
logging console <severity-level>
openapiConsoleLoggingSeveritySet()
openapiConsoleLoggingSeverityGet()