Skip to content

Log management

Amy Buck edited this page Nov 21, 2018 · 9 revisions

OPX utilizes primary systemd-journald for all system logging. Log entries captured by journald can be viewed by the journalctl command.

Application logging format

The syslog format for logging application events is date timestamp hostname severity process_name filename function_name line_number string.

PAS logging

Nov 16 18:16:52 OPX pas_svc: [PAS:PAS]:pas_entity.c:dn_entity_poll:366, PSU 1 is present
Nov 16 18:16:52 OPX pas_svc: [PAS:PAS]:pas_entity.c:dn_entity_poll:366, Fan Tray 1 is present

NAS logging

Nov 16 18:49:18 OPX nas_svc: [INTERFACE:INT-CREATE]:port/nas_int_port.cpp:nas_int_port_create:347, Interface created 0:29:e101-021-0 - 22
Nov 16 18:49:18 OPX nas_svc: [INTERFACE:NAS-INT-CREATE], Interface e101-021-0 initial link state is 2
Nov 16 18:49:18 OPX nas_svc: [INTERFACE:INT-STATE]:port/nas_int_port.cpp:nas_int_port_link_change:312, Interface state change 0:29 to 2

Enable and display application logs (except SAI)

Use opx_logging_cli to enable/disable logging and display logged events for OPX applications, except SAI. In these commands, OPX applications are identified by a module-id value.

Valid values for module-id are either the module ID numbers or the modules names (for example, L3_SERVICES) shown in the opx_logging_cli show-id command output.

opx_logging_cli show [all | module-id] {log-level} {log-sub-level}

Displays the current log for all, or a specified, OPX application modules with information at a specified level and sublevel.

opx_logging_cli {enable | disable} {all log-level | module-id [log-level]

Enables or disables logging for all OPX application modules at all levels or for a specified application module at all levels or a specified level.

If you enter only a module ID, all log levels and log sub-levels are enabled or disabled, or if you enter only a module ID and log level, all log sub-levels are enabled or disabled.

Enable and view SAI application log

The SAI application module has its own specific logging. To enable SAI-specific logs, enter the opx-switch-log set command.

opx-switch-log set [module_name] [level_name]
  • module_name — specifies a SAI module. Options:

    • WRED
    • FDB
    • ROUTE
    • VLAN
    • HOST_INTERFACE
    • ACL
    • MIRROR
    • QOS_QUEUE
    • SCHEDULER_GROUP
    • PORT
    • VIRTUAL_ROUTER
    • NEXT_HOP_GROUP
    • SWITCH
    • POLICER
    • NEIGHBOR
    • UNSPECIFIED
    • SAMPLEPACKET
    • QOS_MAPS
    • ALL
    • STP
    • LAG
    • ROUTER_INTERFACE
    • NEXT_HOP
    • SCHEDULER
  • level_name — sets the SAI logging level to debug, info, notice, warning, critical, or error.

Clone this wiki locally