Recording log
Subscription and execution phases
result1_value, result2_description = ops.syslog(content, severity="informational", logtype="syslog")
Parameter |
Description |
Value |
---|---|---|
content |
Indicates log contents. |
The value is a string of 0 to 512 case-sensitive characters. |
severity |
Indicates the log severity. |
The value is of the enumerated type:
|
logtype |
Indicates the log type. |
The value is syslog, indicating a user log. |
The result1_value and result2_description in the API prototype indicate return values.
The result1_value is the first return value, 0 indicates success, and 1 indicates failure.
The result2_description is the second return value, indicating the failure cause. It is returned only when the first return value is 1.
This API records user logs. The logs can be registered logs on the device or user-defined logs.
When a subscription event is matched, you can record user-defined logs.
value, descri_str = ops.syslog("Some packets are dropped by traffic policy.", "warning", "syslog")