If an exception occurs in an application, you can view the real-time logs of a pod in the SAE or Log Service console to identify the issue.
View real-time logs in the SAE console
Log on to the SAE console. In the left-side navigation pane, choose . On the page that appears, select a region in the top navigation bar and a namespace from the Namespace drop-down list, and then click the desired application name.
On the page that appears, choose in the left-side navigation pane. On the Real-time Logs page, select an instance name from the Pod Name drop-down list.
NoteSAE can display up to 500 most recent logs. If you want to view more logs, use the file log collection feature. For information, see View file logs.
You can select a refresh frequency for real-time logs from the Real-time Log Refresh Frequency drop-down list. Valid values: 5s, 10s, 15s, and Do Not Refresh.

View real-time logs in SLS
You can log on to the SAE console to view real-time logs. You can also collect logs to Log Service by using the output redirection method. This section provides an example on how to collect real-time logs to the stdout.log log source and describes how to view the real-time logs in the Simple Log Service console.
Log on to the SAE console. In the left-side navigation pane, choose . On the page that appears, select a region in the top navigation bar and a namespace from the Namespace drop-down list, and then click the desired application name.
On the Basic Information page of the target application, click Deploy Application.
On the Deploy Application page, expand the Startup Command Settings section to configure a startup command.
For more information, see Configure startup command.

On the Deploy Application page, expand the Log Settings section, enable the Activate Simple Log Service, and configure the parameters.
Select Create Simple Log Service Resource or Use Existing Simple Log Service Resources based on your business requirements. For more information, see Configure log collection to Simple Log Service.
ImportantSpecify the log source that you specified in Step 4 in the Log Source field.
Click OK.
ImportantAfter you click OK, SAE restarts the application. We recommend that you configure the settings during off-peak hours.
After the application is deployed, view real-time logs.
Log on to the SLS console.
In the Projects section, select the project to which real-time logs are collected. On the Logstores tab, select the Logstore to view real-time logs.
References
After you view real-time logs, you can perform related operations on specific logs based on your business requirement. For more information, see the following topics: