You can check instance and application logs to troubleshoot application exceptions. EDAS allows you to bookmark log directories, view logs, and search for logs.
Bookmark log directories
The Log Directories page displays the default log directories that are related to EDAS. You can bookmark or add log directories of your applications. You can view the instance logs in a log directory after you bookmark the log directory. For more information, see View instance logs.
You can also add the log directory to Log Service after you bookmark the log directory so that the application logs in the directory can be viewed and searched on the Log Search page.
- Log on to the EDAS console.
- In the left-side navigation pane, choose .
- On the Applications page, select Region and Namespace. Select Container Service or Serverless Kubernetes Cluster from the Cluster Type drop-down list and click the name of the application that you want to view.
- On the Application Details page, choose Log Directories page, click + Add Online View. in the left-side navigation pane. Then, on the
- In the Add Online View dialog box, specify Application Log Directories and click Add. When you enter the application log directory, follow the following requirements:
- The directory must be in the /home/admin directory.
- The complete directory must contain log or logs.
- The directory name must end with a forward slash (/) to indicate that a folder is added.
View instance logs
After you bookmark application logs, you can view logs of instances and applications.
- On the Application Details page, choose in the left-side navigation pane.
- On the Log Directories page, click the downward button on the left side. In the unfolded log file list,
click View Online in the Actions column. Note In Configuration File for Log Framework, you can view details of a log file and modify the level of the log file. The log levels are TRACE, DEBUG, INFO, WARN, and ERROR in ascending order. After the log level is changed, the system displays the logs of the specified level and higher levels at the bottom of the page.
- On the Real-Time Logs page, select an instance from the ECS Instance ID/Name/IP drop-down list to view the log details of this instance.
In the lower-right corner of the page, click Enable Real-time Additions to ensure that the latest appended content to the file has been added (similar to the
Grant Log Service permissions to a RAM user
If you are a RAM user, you must use Log Service features through the RAM user. The features include adding log directories or files to Log Service, viewing application logs, or performing distributed search. In addition, you must use an Apsara Stack tenant account to authorize RAM users in the RAM console. Perform the following steps:
- Use an Apsara Stack tenant account to log on to the RAM console.
- In the left-side navigation pane, click Users. On the Users page, find the RAM user that you want to authorize, such as doctest, in the user list, and click Add Permissions in the Actions column.
- In the Add Permissions panel, select System Policy in the Select Policy section and enter log in the search box below the System Policy option. Click AliyunLogReadOnlyAccess to add this permission to the Selected list on the right side, and then click OK. Note Principal is loaded by default and does not need to be specified. To grant permissions to multiple RAM users, enter keywords in the search box below Principal to search for and add the RAM users.
- On the authorization result page, view and confirm the RAM user and the granted permission and click Complete.
Remove log directories from bookmarks
When you remove a log directory from bookmarks, the specified log directory is removed. After the log directory is removed, it no longer appears on the Log Directories page. You cannot view instance logs in this directory, but the actual log directory and files are not deleted.
- On the Log Directories page, select a log directory, and click Remove from Favorites.
- In the Remove Log Directory from Bookmark dialog box, verify the log directory to be removed, choose whether to enable Remove Log Directory from Bookmark, and then click Confirm.
- If the log directory is not removed from Log Service, you can view the original application logs in the directory.
- If the log directory is removed from Log Service, you cannot view the application logs in this directory.