When SCF is used for function computation, a large number of function execution logs will be generated. You can view and search for logs generated in the last 15 days in the SCF Console.
If you need to store, deliver, or consume logs in a persistent manner and monitor and set alarms on log content, you can deliver logs to the Tencent Cloud Log Service (CLS) platform as shown below:
Before using the SCF real-time log service, you need to activate CLS first.
Log in to the CLS Console and create a logset and log topic. This document uses the creation of the SCF-test
log set and log topic in Guangzhou as an example as shown below:
Note:
For the logset region, please select the region where the SCF service is located. Cross-region log push is not supported currently.
SCF-test
as an example as shown below:Note:
Log retrieval depends on the index configuration of the log topic. Please enable the index as instructed below:
Note:
For functions configured with CLS, to ensure the display effect of the logs in the SCF Console, please toggle on "Enable Statistics" for the field in the key-value index configuration as shown below:
Field Name | Field Type |
---|---|
SCF_FunctionName | text |
SCF_Namespace | text |
SCF_StartTime | long |
SCF_LogTime | long |
SCF_RequestId | text |
SCF_Duration | long |
SCF_Alias | text |
SCF_Qualifier | text |
SCF_MemUsage | double |
SCF_Level | text |
SCF_Message | text |
SCF_Type | text |
SCF_StatusCode | long |
For more information on other features such as real-time log search, delivery, and consumption, please see the CLS documentation. These features can be used in the CLS Console directly.
Note:
Before using the real-time search feature, please make sure that your SCF log service has been connected to the CLS platform and the index has been enabled for the log topic to be searched.
START
as an example.
Was this page helpful?