This section describes how to enable or disable the function of recording logs when security policy rules are matched.
For the default security policy, click default in the security policy list. On the default security policy configuration page, you can configure the log function.
Enable the function of recording traffic logs.
If you select Enable, traffic logging is enabled for traffic that matches the security policy.
If you select Disable, traffic logging is disabled for traffic that matches the security policy.
If you select NONE, the traffic logging function in the security policy is invalid. You can run the log type traffic enable command to specify whether to log the traffic that matches the security policy.
Enable the function of recording policy matching logs.
Select Enable under Record Policy Matching Log. The device records policy matching logs.
Enable the function of recording session logs.
Select Enable under Record Session Log. The device records session logs after security policy rules are matched.
rule name rule-name
Enable the function of recording traffic logs.
Enable the function of recording policy matching logs.
For non-default security policies:
For the default security policy:
For policy matching logs in syslog format, you can run the policy syslog rate-limit command in the security policy view to configure a specific limiting rate.
For policy matching logs in dataflow format, the device limits the rate based on the default specifications.
Enable the function of recording session logs.
For non-default security policies:
For the default security policy:
<sysname> system-view [sysname] security-policy [sysname-policy-security] rule name policy_sec_marketing [sysname-policy-security-rule-policy_sec_marketing] action deny [sysname-policy-security-rule-policy_sec_marketing] traffic logging enable [sysname-policy-security-rule-policy_sec_marketing] policy logging [sysname-policy-security-rule-policy_sec_marketing] session logging