info-center source channel

Function

The info-center source channel command sets rules for outputting information through information channels.

The undo info-center source channel command deletes the rules for outputting information through information channels.

By default, the default values of logs, traps, and debugging information vary according to the information channel. You can run the display channel command to view the value of the default module of the corresponding channel.

Format

info-center source { module-name | default } channel { channel-number | channel-name } [ log { state { off | on } | level severitylog } * | trap { state { off | on } | level severitytrap } * | debug { state { off | on } | level severitydbg } * ] *

undo info-center source { module-name | default } channel { channel-number | channel-name } [ log { state | level } * | trap { state | level } * | debug { state | level } * ] *

Parameters

Parameter Description Value
module-name

Specifies the name of a module.

You can query all the currently supported modules in Log Reference. In this manual, the log format is simplified as module name/log severity/information keyword, such as INFO/4/FILE_DELETE. (INFO indicates the module name.).

The value is a string of 1 to 31 case-insensitive characters, spaces not supported.

default

Sets default information records.

-

channel-number

Specifies the number of the channel to be set.

The value is an integer ranging from 0 to 9.

channel-name

Specifies the name of the channel to be set.

The value is a string of 1 to 30 case-insensitive characters. The name cannot contain spaces or special characters, such as hyphens (-), slashes (/), or backslashes (\).

log

Indicates logs.

-

state

Indicates the state of logs.

-

off

Disables logs.

-

on

Enables logs.

-

level severitytrap

Specifies the severity of the trap information.

Information management classifies information by severity or urgency into eight levels:

  • emergencies
  • alert
  • critical
  • error
  • warning
  • notification
  • informational
  • debugging
level severitydbg

Specifies the severity of the dbg information.

Information management classifies information by severity or urgency into eight levels:

  • emergencies
  • alert
  • critical
  • error
  • warning
  • notification
  • informational
  • debugging
level severitylog

Specifies the severity of the log information.

Information management classifies information by severity or urgency into eight levels:

  • emergencies
  • alert
  • critical
  • error
  • warning
  • notification
  • informational
  • debugging
trap

Indicates traps.

-

debug

Indicates debugging information.

-

Views

System view

Default Level

3: Management level

Task Name and Operations

Task Name Operations
log write

Usage Guidelines

Usage Scenario

Each information channel has a default record. The module name is default and the module number is 0xffffffff. The default values of the log, trap, and debugging information may be different for different information channels. If a module does not have a specific configuration record in this channel, the default configuration record is used.

The IM module generates logs for all command line operations. Run the display channel loghost command to view the default module of the loghost channel. The log information is in the on state and the allowed information level is informational. The trap information is in the on state and the allowed information level is debugging. Debugging information. The status is off.

If the configuration record of the IM module of the loghost channel does not exist on the device, the IM module of the loghost channel uses the value of the default module of the loghost channel.

If you run the info-center source im channel loghost log level informational trap state off debug state off command, the value of the IM module of the loghost channel is changed to on, and the allowed information level is informational. For trap information, the value of the IM module is off. Debugging information. The status is off. That is, the IM module in the loghost direction records only logs with the severity level of informational or higher, but does not record trap and debugging information.

In this case, if you run the info-center source im channel loghost log level debugging state on trap state off debug state off command again, the value of the IM module of the loghost channel is changed to on, and the allowed information level is debugging. For trap information, the value of the IM module is off. Debugging information. The status is off. That is, the IM module in the loghost direction records all logs but does not record trap and debugging information.

If a module generates a large number of logs, traps, or debugging information in a short period of time, you can set the level severity parameter to adjust the information channel level. In this way, low-level information will be filtered. Set the state off parameter to disable all messages sent by the specified module.

Example

# Enable the log function for the console module of the SNMP channel, and set the minimum level of logs that can be output to emergence.
<HUAWEI> system-view
[~HUAWEI] info-center source cli channel snmp log level emergencies
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >