- Table of Contents
-
- 03-System Management Configuration Guide
- 00-Preface
- 01-Basic device management configuration
- 02-Device hardening configuration
- 03-Hardware resource management configuration
- 04-EAA configuration
- 05-Process monitoring and maintenance configuration
- 06-Fast log output configuration
- 07-Flow log configuration
- 08-Information center configuration
- 09-GOLD configuration
- Related Documents
-
Title | Size | Download |
---|---|---|
06-Fast log output configuration | 59.05 KB |
Contents
Restrictions and guidelines: fast log output configuration
Configuring fast log output to use the UTF-8 encoding
Fast log output configuration examples
Example: Configuring fast log output to a log host
Configuring fast log output
About fast log output
The fast log output feature enables fast output of logs to log hosts.
Typically, logs generated by a service module are first sent to the information center, which then outputs the logs to the specified destination (such as to log hosts). When fast log output is configured, logs of service modules are sent directly to log hosts instead of to the information center. Compared to outputting logs to the information center, fast log output saves system resources. For more information about the information center, see "Configuring the information center."
Logs are classified into eight severity levels from 0 through 7 in descending order.
Severity value |
Level |
Description |
0 |
Emergency |
The system is unusable. For example, the system authorization has expired. |
1 |
Alert |
Action must be taken immediately. For example, traffic on an interface exceeds the upper limit. |
2 |
Critical |
Critical condition. For example, the device temperature exceeds the upper limit, the power module fails, or the fan tray fails. |
3 |
Error |
Error condition. For example, the link state changes. |
4 |
Warning |
Warning condition. For example, an interface is disconnected, or the memory resources are used up. |
5 |
Notification |
Normal but significant condition. For example, a terminal logs in to the device, or the device reboots. |
6 |
Informational |
Informational message. For example, a command or a ping operation is executed. |
7 |
Debugging |
Debug message. |
Restrictions and guidelines: fast log output configuration
The device supports outputting logs from service modules to log hosts by using the following methods in descending order of priority:
1. Fast log output.
2. Flow log. For more information about flow log and the service modules supported by flow log, see "Configuring flow log."
3. Information center.
If you configure multiple log output methods for a service module, the service module outputs its logs in the method that has the highest priority.
To output NAT logs to a log host, you must specify the log format required by the log host in the customlog format and customlog host commands.
Procedure
1. Enter system view.
system-view
2. Enable fast log output.
customlog format { aft | attack-defense | dpi [ ips [ sgcc { policy-hit | signature-update } ] ] | nat { cmcc | telecom | unicom } | packet-filter [ sgcc ] | security-policy [ match | sgcc ] | session }
By default, fast log output is disabled.
3. Configure fast log output parameters.
customlog host [ vpn-instance vpn-instance-name ] { hostname | ipv4-address | ipv6 ipv6-address } [ port port-number ] export { aft | attack-defense | dpi [ ips ] * | nat { sessionlog | userlog } * | packet-filter | security-policy | session } *
By default, no fast log output parameters are configured.
The value for the port-number argument must be the same as the port number configured on the log host. Otherwise, the log host cannot receive logs.
4. (Optional.) Specify the source IP address for fast log output.
customlog host source interface-type interface-number
By default, the source IP address of fast output logs is the primary IP address of the outgoing interface.
If this command is configured, the primary IP address of the specified interface is used as the source IP address of fast output logs regardless of the outgoing interface.
Configure this command when you need to filter logs by source IP address on the log host.
5. (Optional.) Configure the timestamp of fast output logs to show the system time.
customlog timestamp localtime
By default, the timestamp of fast output logs shows the Greenwich Mean Time (GMT).
Configuring fast log output to use the UTF-8 encoding
About this task
The fast log output module and the log host must use the same character set encoding. If they use different encodings, the log host cannot correctly display Chinese characters in the log messages received from the fast log output module. By default, fast log output uses the GB18030 encoding. You can perform this task to configure fast log output to use the UTF-8 encoding.
Procedure
1. Enter system view.
system-view
2. Configure fast log output to use UTF-8 encoding.
customlog character-encoding utf-8
By default, fast log output uses the GB18030 encoding.
Fast log output configuration examples
Example: Configuring fast log output to a log host
Network configuration
As shown in Figure 1, configure fast log output on the device to send session logs to the log host.
Procedure
1. Make sure the device and the log host can reach each other. (Details not shown.)
2. Configure the device:
# Enable fast log output for the session management module.
<Device> system-view
[Device] customlog format session
# Output logs of the session management module to the log host at 1.2.0.1/16.
[Device] customlog host 1.2.0.1 port 1000 export session
# Enable logging for session creation and deletion.
[Device] session log flow-begin
[Device] session log flow-end
# Enable IPv4 session logging in the inbound direction of Ten-GigabitEthernet 0/0/6, the interface connected to the internal network.
[Device] interface ten-gigabitethernet 0/0/6
[Device-Ten-GigabitEthernet0/0/6] session log enable ipv4 inbound
3. Configure the host:
The log host configuration varies by log host. For more information, see related document of the log host.
Verifying the configuration
On the host, verify that logs are received from the device successfully.