View log directories

更新时间:
复制 MD 格式

If your application encounters an exception, you can check its instance and application logs to troubleshoot the issue. EDAS provides features that allow you to add log directories to favorites, view logs, and search for logs.

Favoriting log folders

The Log Directory page lists the default log directories for EDAS. You can add your application log directories to your favorites. After a log directory is added to your favorites, you can view the instance logs in that directory. For more information, see View instance logs.

When you add a log directory to your favorites, you can also select Add to Simple Log Service. This lets you view and search for application logs from that directory on the Log Search page.

Note You can only add log directories to favorites or remove them from favorites.
  1. Log on to the EDAS consoleEDAS console.

  2. In the navigation pane on the left, choose Application Management > Application List.
  3. On the Application List page, select a Region and Namespace. From the Cluster Type drop-down list, select Container Service for Kubernetes (ACK)/Serverless Kubernetes (ASK) Cluster, and then click the name of the application.
  4. In the navigation pane on the left of the application details page, choose Log Management > Log Directory. Then, on the Log Directory page, click + Add Online View.
  5. In the Add Online View dialog box, enter an Application Log Directory and click Add.
    The application log directory must meet the following requirements:
    • The directory must be under /home/admin.
    • The full path must contain log or logs.
    • The path must end with a forward slash (/) to indicate that you are adding a folder.

View instance logs

After collecting application logs, you can view logs at the instance and application levels.

  1. In the navigation pane on the left of the application details page, choose .
  2. On the Log Directory page, click the expand icon to the left of a log directory. In the Actions column of the log file list that appears, click View Online.
    Note Log Framework Configuration File, you can view log details and modify the log level of the file. Log levels from lowest to highest are: TRACE, DEBUG, INFO, WARN, and ERROR. After you change the log level, the system displays logs at the selected level and higher.
  3. At the top of the Real-time Log page, click the drop-down arrow next to ECS Instance ID/Name/IP, select an instance, and view its log details.
    查看实时日志详细信息
    In the lower-right corner of the page, click Enable Real-time Append to continuously load the latest content appended to the file. This is similar to the tailf command.

Grant Simple Log Service permissions to a RAM user

If you are a RAM user and need to use Simple Log Service (including adding log directories or files to Simple Log Service, viewing application logs, and performing distributed searches), your Alibaba Cloud account administrator must grant you the required permissions in Resource Access Management (RAM). Follow these steps:

  1. Log on to the RAM console with your Alibaba Cloud account.
  2. In the navigation pane on the left, click Users. On the Users page, find the RAM user that you want to grant permissions to, such as doctest, and click Add Permissions in the Actions column.
  3. On the Add Permissions page, enter log in the search box next to System Policy. Click AliyunLogReadOnlyAccess to add the policy to the list on the right, and then click OK.
    Note Principal is loaded by default and does not need to be set. To grant permissions to multiple RAM users at the same time, search for and add them by keyword in the search box under Principal.
  4. On the Authorization Result page, review the RAM user and the granted permissions. After you confirm that the information is correct, click Done.

Remove a log directory from favorites

You can remove an application log directory from your favorites. After a directory is removed, it no longer appears on the Log Directory page, and you can no longer view its instance logs. This action does not delete the actual log directory or its files.

Note You can also remove default directories from favorites.
  1. On the Log Directory page, select a log directory and click Remove from Favorites.
  2. In the Remove Log Directory from Favorites dialog box, confirm the log directory that you want to remove, select whether to Also remove from Simple Log Service, and click OK.
    • If you do not remove the directory from Simple Log Service, you can still view the existing application logs in that directory.
    • If you remove the directory from Simple Log Service, you can no longer view the application logs in that directory.