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, click Applications. In the top navigation bar, select a region. Then, click the name of an application.
- In the left-side navigation pane, choose . On the Real-time Logs page, select an instance name from the Pod Name drop-down list. Note
- SAE 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 the Log Service console
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 Log Service console.
Log on to the SAE console.
In the left-side navigation pane, click Applications. In the top navigation bar, select a region. Then, click the name of an application.
In the upper-right corner of the Basic Information page, click Deploy Application.
- On the Deploy Application page, expand the Startup Command Settings section to configure a startup command. For more information, see Configure a startup command.
- On the Deploy Application page, expand the Log Collection Service section, turn on Enable Log Collection to Log Service, and configure the parameters. Select Create Log Service Resource or Use Existing Log Service Resources based on your business requirements. For more information, see Configure log collection to Simple Log Service.Important Specify the log source that you specified in Step 4 in the Log Source field.
- Click Confirm. Important After you click Confirm, 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 Log Service 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: