You can view logs in the Enterprise Distributed Application Service (EDAS) console but you cannot download them. By using the EDAS CLI, you can download and view logs. This topic describes how to use the EDAS CLI to download and view logs by taking the Windows operating system as an example.

Install the EDAS CLI

  1. Download the installation package according to your operating system.
  2. Decompress the EDAS CLI package. The EDAS CLI is installation free.
  3. Add the EDAS CLI installation path to the PATH environment variable.
  4. In the command line, run edas help.
    • If the help information appears, the installation is successful.
    • If the help information does not appear, check the preceding steps for troubleshooting.

Configure the EDAS CLI

Before using the EDAS CLI, you must configure the AccessKey, region, language, and broker that are used to call Alibaba cloud resources.

  1. In the command line, run edas configure.
  2. Set parameters as prompted.
    Note If you had configured the parameter, the previously set value is appended to the parameter. You can use the previous settings or reset them.
    • AccessKey: it includes AccessKey Id and AccessKey Secret. You can log on to the User Management page to get them.
    • Default Region ID: the ID of the region where you application is deployed. For the list of regions supported by EDAS, see Guide of using Alibaba Cloud CLI to call the EDAS API.
    • Default Output Format: the output format. Only JavaScript is supported currently.
    • Default Language: the language. You can select Chinese (zh) or English (en).
    • Broker:EDAS CLI: the broker. You need to use an Elastic Compute Service (ECS) instance that runs Secure Shell Daemon (SSHD) in a Virtual Private Cloud (VPC) as the proxy server, namely, the broker, to connect the local environment and other VPCs. So you need to configure the broker information, including: Broker Address (The IP address of the broker), Port, User (the username used to log on to the broker) and Password (the password used to log on to the broker) and Identity File (required if you log on by using an AccessKey pair).
    After the setting is complete, the welcome message of EDAS CLI appears.

Download logs

Note The bandwidth and traffic of the broker are consumed when logs are downloaded through the EDAS CLI.
  1. In the command line, run edas logs <target application instance IP/ID> <log path> -o <target log download path>, such as edas logs 192.168.16.87 /home/admin/taobao-tomcat-production-7.0.59.3/logs/catalina.log.2019-03-27.log -o D:\logs.

    There are other command formats to download the logs. You can run edas --help for more information.

    When the download information and Done appear, the download is complete.
  2. Check whether the downloaded logs are in the local destination path.
    By default, logs are saved in a folder named after the IP address of the application instance, for example, 192.168.16.87. Go to the folder, you can see the downloaded log file, such as catalina.log.2019-03-27.log.

View logs

Double-click a log file to open it and view the content.