During task operations and maintenance (O&M), you can use logs to locate and diagnose problems. Serverless App Engine (SAE) provides real-time and persistent logs that you can view online or download. This topic describes how to use SAE to set log collection rules for a Job template and view the logs.
Prerequisites
Create a Job template
Background information
SAE provides the following types of logs.
Real-time logs: Standard output logs that help you locate pod problems.
Persistent logs: When you create or deploy a task, SAE automatically connects to Simple Log Service (SLS). SAE sends container standard output (stdout) logs and business file logs from within the container to SLS. This lets you view an unlimited number of log entries and perform aggregation and analysis.
View real-time logs
On the SAE Job Templates page, select a target region and namespace at the top. Click the target Job template to go to the details page.
In the navigation pane on the left, click .
On the Real-time Log page, select a target instance from the POD Name drop-down list and a refresh rate from the Real-time Log Refresh Rate drop-down list.
NoteSAE displays a maximum of the 500 most recent log entries. To view more entries, use the file log feature to view persistent logs. For more information, see Set up log collection in SLS.
Set up log collection in SLS
Procedure:
On the SAE Job Templates page, select a target region and namespace at the top. Click the target Job template to go to the details page.
On the Job Template Details page, click Edit Job Template.
Expand the Log Configuration section and turn on SLS Log Service.
Configuration details:
For more information, see Set up log collection in SLS.