You can check instance logs and application logs to handle application exceptions. Enterprise Distributed Application Service (EDAS) allows you to add log directories to favorites, view logs, and search for logs.
Add log directories to favorites
The Log Directory page displays the default log directories of EDAS. You can add log directories of your applications to favorites.
When you add a log directory to favorites, you can also add the log directory to Log Service. This way, you can view and search for the application logs in the directory on the Search Logs page.
- Log on to the EDAS console.
- In the left-side navigation pane, click Applications. In the top navigation bar, select a region. In the upper part of the page, select a namespace.
- On the Applications page, 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 manage.
- In the left-side navigation pane, click Logs. On the Logs page, click the Log Directories tab.
- In the upper-right corner of the Log Directories tab, click Add Online View.
- In the Add Online View dialog box, specify the directory in Application Log Directory, select whether to turn on Add Path to Log Service, and then click Add. Meet the following requirements when you specify the application log directory:
- The directory must be in /home/admin.
- The full directory must contain log or logs.
- The directory must end with a slash (/). This indicates that a folder is to be added.
View instance logs
After you add application logs to favorites, you can view the logs of instances and applications.
- On the Log Directories page, click the Unfold icon on the left side. In the log file list that is expanded,
click View in the Actions column. Note You can view log details and modify the log level for the log files in File for Log Frame Configuration. 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 set level and higher levels in the lower part of the page.
- On the Real-time Logs tab, select an instance from the ECS Instance ID/Name/IP drop-down list on the right side to view the log details of this instance.
Click Enable Real-time Additions in the lower-right corner of the page to ensure that the latest appended content to the file has been added. This is similar to the
Grant permissions on Log Service to a RAM user
Assume that you want to use Log Service as a RAM user. For example, you may want to add log directories or files to Log Service, view application logs, or perform distributed searches. In this case, you must use an Alibaba Cloud account to authorize the RAM user in the Resource Access Management (RAM) console. Perform the following steps:
- Use an Alibaba Cloud account to log on to.
- In the left-side navigation pane, choose Users page, find the RAM user that you want to authorize and click Add Permissions in the Actions column. . On the
- On the Add Permissions panel, click System Policy under Select Policy and enter log in the search box. Click AliyunLogReadOnlyAccess to add this permission to the Selected section on the right side and click OK. Note Principal is automatically configured. You do not need to configure this parameter. To grant permissions to multiple RAM users, enter keywords in Principal to search for the RAM users that you want to add, and add them to Principal.
- On the Add Permissions panel, view the RAM user and granted permissions. After confirmation, click Complete.
Remove log directories from favorites
When you remove a log directory from favorites, a specified log directory of your application is removed. After the log directory is removed, it is no longer displayed on the Log Directory page. You cannot view instance logs in this directory. However, this operation does not delete the actual log directory or file.
- On the Log Directory page, select a log directory, and click Remove Log Directory from Bookmark.
- In the Remove Log Directory from Bookmark dialog box, verify the log directory that you want to remove, select whether to enable
Delete Project and Logstore Related with the Log, and then click Confirm. When you remove a log directory from favorites, you can select Remove Log Directory from Bookmark.
- If the log directory is not deleted from Log Service, you can view the original application logs in this directory.
- If the log directory is deleted from Log Service, you cannot view the application logs in this directory.