In the Enterprise Distributed Application Service (EDAS) console, you can view logs but you cannot download them. You can use the EDAS CLI to download and view logs. This topic uses the Windows operating system as an example to describe how to use the EDAS CLI to download and view logs.

Install the EDAS CLI

  1. Download the installation package based on 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. On the command line, run the edas help command.
    • 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 you use the EDAS CLI, you must configure the AccessKey pair, region, language, and broker that are used to call Alibaba Cloud resources.

  1. On the command line, run the edas configure command.
  2. Set parameters as prompted.
    Note If you had set the parameters, the previously set values are appended to the parameters. You can use the previous settings or reset the parameters.
    • AccessKey: the AccessKey pair, including AccessKey ID and AccessKey Secret. You can log on to the User Management page to obtain them.
    • Default Region ID: the ID of the region where your application is deployed. For more information about the regions supported by EDAS.
    • Default Output Format: the output format. Only JavaScript is supported.
    • Default Language: the language. You can select Chinese (zh) or English (en).
    • Broker: the broker. The EDAS CLI requires an Elastic Compute Service (ECS) instance that runs Secure Shell Daemon (SSHD) in a virtual private cloud (VPC) as the proxy server, which is the broker, to connect the local environment and other VPCs. Therefore, you must configure the broker information, including: Broker Address (the IP address of the broker), Broker Port, Broker User (the username used to log on to the broker), Broker Password (the password used to log on to the broker), and Broker Identity File (required if you log on by using an AccessKey pair. For more information, see Overview).
    After the setting is complete, the welcome message of the EDAS CLI appears.

Download logs

Note The bandwidth and traffic of the broker are consumed when the EDAS CLI is used to download logs.
  1. On the command line, run the edas logs <IP address or ID of the application instance> <log path> -o <path to save logs> command. For example, run 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.

    You can download the logs by using other command formats. You can run the edas --help command for more information.

    When the download information and Done appear, the download is complete.
  2. Check whether the downloaded logs are in the local path where you want to save the logs.
    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.