Logging Configuration
Configuration Overview
BDS (Brick Data Store) is an in-memory state database and a core component of RBFS. It stores all system state information as structured objects within its tables. Acting as a central communication hub across components, BDS generates a substantial volume of logs that are essential for monitoring.
You can enable logging for:
-
Brick Daemon (such as
pppod
,ipod
,confd
, and so on) -
Modules (such as OSPF, BGP, ISIS, and so on)
-
Host (ONL) system
Once logs are generated, you view logs:
-
In the
var
log files -
Using operational commands
You can export the logs to an external server using the formats:
-
GELF
-
Syslog
Configuration Syntax and Commands
The following sections describe the logging configuration syntax and commands.
BDS Logging Configuration
You can configure BDS logging for a BD, a module, and for a group.
A specific configuration takes priority over a generic configuration. For example, if you have configured a global log level of bgp.iod.1 to "warning", and you have configured a log level of bgp module to "notice", then the final log level of bgp will be "notice".
|
Configuring BDS Logging for a Brick Daemon
You can configure BDS logging for a brick daemon or all daemons to generate logs related that daemon/daemons.
Syntax:
set log bd <bd-name> <option> …
Attribute | Description |
---|---|
<bd-name> |
Configure for the specified BD name. |
all |
Configure for all BDs. |
module <module-name> |
Module name. For more information, see the section "Configuring BDS Logging for a Module". |
plugin-alias alias-name <alias-name> |
Specify the external log management server name for sending the logs to the server. |
plugin-alias level <level> |
Log severity level. You can filter logs based on the log severity levels for sending to the external log management server. This allows to send only the required log messages to the log management server instead of sending a whole lot of data. For example, if you configure |
Example 1: BDS logging for a BD Configuration
{ "ietf-restconf:data": { "rtbrick-config:system": {}, "rtbrick-config:log": { "bd": [ { "bd-name": "bgp.iod.1", "level": "info", "plugin-alias": { "alias-name": "ztp", "level": "error" } } ] }
Configuring BDS Logging for a Module
You can enable logging for a module such as BGP, IS-IS, and so on.
Syntax:
set log module <module-name> <option> …
Attribute | Description |
---|---|
<module-name> |
Module name |
group <group-name> |
BDS log module log-group configuration. For more information, see the section "Configuring BDS Logging for a Group". |
level <level> |
Log severity level. |
plugin-alias alias-name <alias-name> |
Plugin alias name |
plugin-alias level <level> |
Log level. You can filter logs based on the log severity levels for sending to the log management server. This will help you to send only the required log messages to the log management server instead of sending a whole lot of data. For example, if you configure |
Example 1: Logging Module Configuration
{ "ietf-restconf:data": { "rtbrick-config:system": {}, "rtbrick-config:log": { "module": [ { "module-name": "igmp", "level": "info", "plugin-alias": { "alias-name": "graylog-srv1", "level": "warning" } } ] } } }
Configuring BDS Logging for a Group
You can enable logging for a group of log IDs. This configuration allows you to generate logs for a group of log IDs (also known as log maps). Using log groups, you can enable logging for a specific set of log IDs. This approach gives you more targeted control over log generation, helping you collect only the relevant information without overwhelming the system.
Syntax:
set log module <module-name> group <group-name> <option> …
Attribute | Description |
---|---|
<group-name> |
Group name |
level <level> |
Specifies the level of the plug-in alias. |
rate-limit <rate-limit> |
Rate-limiting is only supported for log groups. Configuring a higher rate-limit for a whole module may cause system instability due to generation of high volume of logs. The default value is 10. |
plugin-alias alias-name <alias-name> |
Plugin alias name |
plugin-alias level <level> |
Specifies the level of the plug-in alias. You can filter logs based on the log severity levels for sending to the log management server. This will help you to send only the required log messages to the log management server instead of sending a whole lot of data. For example, if you configure |
Example 1: Logging Group Configuration
{ "ietf-restconf:data": { "rtbrick-config:log": { "module": [ { "module-name": "bgp", "group": [ { "group-name": "interface", "level": "warning" } ] } ] } } }
System Logging Configuration
LXC and ONL Logging Configuration
In addition to configuring logging for the various daemons and modules in RBFS container, you can also enable logging for the underlying ONL host syste. You can send logs from Linux and ONL system facilities such as auth
, authpriv
, daemon
, and kern
to the log management server.
Also, you can configure an external log management server to transport logs. Currently, Syslog and Graylog are the log management servers supported by RBFS.
Syntax:
set log system facility <facility-name> plugin-alias <attribute> <value>
Attribute | Description |
---|---|
<facility-name> |
Supported facilities include |
plugin-alias alias-name <alias-name> |
Plugin alias name |
plugin-alias level <level> |
Specify the level of the plug-in alias. You can filter logs based on the log severity levels for sending to the log management server. This will help you to send only the required log messages to the log management server instead of sending a whole lot of data. For example, if you configure |
Example 1: System Log Configuration
{ "ietf-restconf:data": { "rtbrick-config:log": { "system": { "facility": [ { "facility-name": "kern", "plugin-alias": { "alias-name": "graylog", "level": "notice" } } ] } } } }
External Log Server (Plugin Alias) Configuration
You can configure an external log management server as a destination to send logs.
Syntax:
set system host log-alias <attribute> <value>
Attribute | Description |
---|---|
<name> |
Log alias name |
<address> |
Plugin address. For example, Gelf: http://11.1.1.1:1102/gelf Syslog: 10.1.1.1:8008 |
level |
Severity level for the log. |
network |
Log alias endpoint port. |
type |
Server type of log alias. |
Example 1: Log alias Configuration
set system host log-alias bng endpoint http://10.1.1.1:1102/gelf set system host log-alias bng endpoint http://10.1.1.1:1102/gelf type gelf set system host log-alias bng endpoint http://10.1.1.1:1102/gelf network http set system host log-alias bng endpoint http://10.1.1.1:1102/gelf level info { "ietf-restconf:data": { "rtbrick-config:system": { "host": { "log-alias": [ { "name": "bng", "endpoint": [ { "address": "http://10.1.1.1:1102/gelf", "type": "gelf", "network": "http", "level": "info" } ] } ] } } } }
This following configuration sets up how system logs will be exported to an external log collector, in this case, Graylog.
Example configuration for Graylog with the domain name:
set system set system host set system host log-alias graylog set system host log-alias graylog endpoint http://10.1.1.1:2002/gelf set system host log-alias graylog endpoint http://10.1.1.1:2002/gelf type gelf set system host log-alias graylog endpoint http://10.1.1.1:2002/gelf network http set system host log-alias graylog endpoint http://10.1.1.1:2002/gelf level info
{ "ietf-restconf:data": { "rtbrick-config:system": { "host": { "log-alias": [ { "name": "graylog", "endpoint": [ { "address": "http://10.1.1.1:2002/gelf", "type": "gelf", "network": "http", "level": "info" } ] } ] } } } }
Example for Syslog configuration with TCP:
set system set system host set system host log-alias syslog set system host log-alias syslog endpoint 10.200.32.49:525 set system host log-alias syslog endpoint 10.200.32.49:525 type syslog set system host log-alias syslog endpoint 10.200.32.49:525 network tcp
supervisor@rtbrick: cfg> show config { "ietf-restconf:data": { "rtbrick-config:system": { "host": { "log-alias": [ { "name": "syslog", "endpoint": [ { "address": "10.200.32.49:525", "type": "syslog", "network": "tcp" } ] } ] } } } }
Example for Syslog configuration with UDP:
set system set system host set system host log-alias syslog set system host log-alias syslog endpoint 10.200.32.49:525 set system host log-alias syslog endpoint 10.200.32.49:525 type syslog set system host log-alias syslog endpoint 10.200.32.49:525 network udp
supervisor@rtbrick: cfg> show config { "ietf-restconf:data": { "rtbrick-config:system": { "host": { "log-alias": [ { "name": "syslog", "endpoint": [ { "address": "10.200.32.49:525", "type": "syslog", "network": "udp" } ] } ] } } } }