Before you can query and analyze the execution logs of functions, you must enable the logging feature of Function Compute. This topic describes how to enable the logging feature in the Function Compute console.
- Log on to the Function Compute console.
- In the left-side navigation pane, click Services & Functions.
- In the top navigation bar, select a region based on your business requirements.
- On the Services page, click Create Service.
- In the Create Service panel, set the parameters and click OK. The following table describes the parameters. For more information, see Create a Service.Notice The first time you enable the logging feature, a message appears after you click OK in the Create Service panel. You must authorize Function Compute to assume the AliyunFcDefaultRole role. This way, Function Compute can access Log Service. In the message, click Authorize Now and complete the authorization as prompted.
Parameter Description Service Name The name of the service. Logging Specifies whether to enable the logging feature.
- Enable: If you select Enable, Log Service generates a project named aliyun-fc-region ID-**** and a Logstore named function-log in the corresponding region. Indexing is enabled for the Logstore.
- Disable: If you select Disable, the execution logs of Function Compute are not delivered to Log Service.