If you want to query and analyze the execution logs of functions, you must enable the log query feature of Function Compute. This topic describes how to enable the log query feature in the Function Compute console.
- Log on to the Function Compute console.
- In the upper-left corner of the page, select a region.
- In the left-side navigation pane, click Service/Function.
- Create a service.
- In the Create Function drop-down list, select Create Service.
- Set the following parameters, and then click Create.
Parameter Description Service Name The name of the service. Bind Log Click Bind Log to enable the log query feature. Log Service creates a project named aliyun-fc-region ID-bb47c1e4-cdd4-5318-978e-d748952652c8 and a Logstore named function-log.Note If you bind logs for the first time, the Cloud Resource Access Authorization dialog box appears after you click Create. You must authorize Function Compute to use the role AliyunFCLogExecutionRole to access Log Service.
After you enable the log query feature, execution logs are immediately collected. Log Service creates dedicated projects and dedicated Logstores. The log index feature is also automatically enabled.