info-center loghost (System view)

Function

The info-center loghost command configures a device to output logs to a syslog server.

The undo info-center loghost command disables a device from outputting logs to a syslog server.

A device does not output logs to any syslog server by default.

Format

info-center loghost ipv4-address [ { local-time | utc } | channel { channel-number | channel-name } | { public-net | vpn-instance vpn-instance-name } | source-ip source-ip-address | facility local-num | level level-num | port server-port | transport { udp | tcp [ ssl-policy policy-name [ [ security ] [ verify-dns-name dns-name ] ] ] } ] *

info-center loghost ipv6 ipv6-address [ { local-time | utc } | channel { channel-number | channel-name } | { public-net | vpn-instance vpn-instance-name } | source-ip source-ipv6-address | facility local-num | level level-num | port server-port | transport { udp | tcp [ ssl-policy policy-name [ [ security ] [ verify-dns-name dns-name ] ] ] } ] *

undo info-center loghost ipv4-address [ vpn-instance vpn-instance-name ]

undo info-center loghost ipv6 ipv6-address [ vpn-instance vpn-instance-name ]

Parameters

Parameter Description Value
ipv4-address

Specifies the IPv4 address of a syslog server.

The value is in dotted decimal format.

local-time

Indicates the local time.

-

utc

Indicates the Universal Time Coordinated (UTC).

-

channel channel-number

Specifies a channel number.

The value is an integer ranging from 0 to 9.0: console1: monitor2: loghost3: trapbuffer4: logbuffer5: snmpagent6: channel67: channel78: channel89: channel9

channel channel-name

Specifies a channel name.

The value is a string:console: Consolemonitor: Remote terminalloghost: Syslog servertrapbuffer: Trap bufferlogbuffer: Log buffersnmpagent: SNMP agentchannel6: Unspecifiedchannel7: Unspecifiedchannel8: Unspecifiedchannel9: Information file

public-net

Indicates the logs sent to a syslog server over the public network.

-

vpn-instance vpn-instance-name

Specifies name of a virtual private network (VPN) instance of a syslog server.

The value is a string of 1 to 31 case-sensitive characters, spaces not supported. In addition, the VPN instance name must not be _public_. When double quotation marks are used around the string, spaces are allowed in the string.

source-ip source-ip-address

Specifies the source IPv4 address of packets to be sent to a syslog server.

The value is in dotted decimal format.

source-ip source-ipv6-address

Specifies the source IPv6 address of packets to be sent to a syslog server.

The format is H-H-H. Each H represents four hexadecimal digits.

facility local-num

Specifies a syslog server facility that is used to identify the log information source. You can use this parameter to plan a local value for the log information of a specified device, so that the syslog server can handle received log information based on the parameter.

The value is an enumerated type: local0, local1, local2, local3, local4, local5, local6, or local7. The default value is local7.

level level-num

Specifies a log level.

The value is an enumerated type:

emergencies: an emergency error.

alert: an error that needs to be corrected immediately

critical: a major error

error: a minor error

warning: a potential error

notification: information that needs to be noticed

informational: an informational message

debugging: detailed information for debugging use

The default value is debugging.

port server-port

Specifies the destination port number of packets to be sent to a syslog server.

The value is an integer ranging from 1 to 65535.

  • If UDP is specified as the transport mode, the default port number is 514.
  • If TCP is specified as the transport mode, the default port number is 601.
  • If Secure Sockets Layer (SSL) is specified in the TCP transport mode, the default port number is 6514.
transport

Indicates the information transport mode.

-

udp

Indicates that the information transport mode is UDP.

-

tcp

Indicates that the information transport mode is TCP.

-

ssl-policy policy-name

Specifies the name of a Secure Sockets Layer (SSL) policy when packets are transmitted using TCP.

SSL encrypted transmission provides high security. If packets are transmitted on insecure networks, configure SSL encrypted transmission by specifying ssl-policy policy-name. If packets are transmitted on secure networks, configure UDP transmission mode by specifying udp or TCP transmission mode by specifying tcp.

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

security

Specifies a security log host.

If the security parameter is set, the system sends only security logs to the log host.

-

verify-dns-name dns-name

Specifies the DNS server certificate name for the logging host.

String form, does not support space, case sensitive, length range is 1 to 255

ipv6 ipv6-address

Specifies the IPv6 address of a syslog server.

The value is a hexadecimal number in the format of X:X::X:X.

Views

System view

Default Level

3: Management level

Task Name and Operations

Task Name Operations
log write

Usage Guidelines

Usage Scenario

To configure a device to output logs to a syslog server, run the info-center loghost command. The system logs information about device operations in real time. These logs can be output to the syslog servers for storage and query. If a problem occurs, you can check the logs to learn about what happened to the device during device operation and analyze fault causes.

Prerequisites

Information management has been enabled using info-center enable, and the IP address of a syslog server is reachable.

Configuration Impact

Logs record information about users' operations on an existing device (such as command configuration operation) and specific events (such as a network connection failure). After the info-center loghost command is run, an existing device outputs generated logs to the specified syslog server.

Precautions

The configured log host level does not take effect on security logs.

Rules for a single host to select a VPN

  • Rule 1: If the info-center loghost command is run with vpn-instance specified, the specified VPN is used as the host's VPN. Otherwise, refer to rule 2.
  • Rule 2: If the set net-manager vpn-instance command is run to configure a global VPN, the global VPN is used as the host's VPN. Otherwise, refer to rule 3.
  • Rule 3: The public network is used to send logs.

Example

# Configure a device to output logs to the syslog server at 192.168.160.1.
<HUAWEI> system-view
[~HUAWEI] info-center loghost 192.168.160.1
# Configure a soure IPv6 address for the syslog server.
<HUAWEI> system-view
[~HUAWEI] info-center loghost ipv6 2001:db8:2::1 source-ip 2001:db8:1::1
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >