Updated on 2024-05-27 GMT+08:00

Configuring VM Log Collection Paths

AOM can collect and display VM logs. A VM refers to an Elastic Cloud Server (ECS) running Linux. Before collecting logs, ensure that you have set a log collection path.

Prerequisites

You need to install an ICAgent on your VM. About five minutes after the ICAgent is installed, you can view your VM in the VM list on the Log Analysis > Log Paths page.

Precautions

  • An ICAgent collects *.log, *.trace, and *.out log files only. For example, /opt/yilu/work/xig/debug_cpu.log.
  • Ensure that an absolute path of a log directory or file is configured and the path exists. For example, /opt/yilu/work/xig or /opt/yilu/work/xig/debug_cpu.log.
  • The ICAgent does not collect log files from subdirectories. For example, the ICAgent does not collect log files from the /opt/yilu/work/xig/debug subdirectory of /opt/yilu/work/xig.
  • A maximum of 20 log collection paths can be configured for a VM.
  • For ECSs in the same resource space, only the latest log collection configuration in the system will be used. AOM and LTS log collection configurations cannot take effect at the same time. For example, if you configure log collection paths in AOM for ECSs, the previous collection configurations you made in LTS for these ECSs become invalid.

Configuring Log Collection Paths

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane, choose Log Analysis > Log Paths.
  3. In the VM list, click in the Operation column to configure one or more log collection paths for a VM.

    You can use the paths automatically identified by the ICAgent or manually configure paths.
    • Using the Paths Automatically Identified by the ICAgent

      The ICAgent automatically scans the log files of your VM, and displays all the .log, .trace, or .out log files with handles and their paths on the page.

      You can click in the Operation column to add a path automatically identified by the ICAgent to the configured log collection path list. To configure multiple paths, repeat this operation.

      Figure 1 Using the paths automatically identified by the ICAgent
    • Manual configuration

      If the paths automatically identified by the ICAgent cannot meet your requirements, enter a log directory or file (for example, /usr/local/uniagentd/log/agent.log) in the Collection Path text box, and then add the path to the configured log collection path list. To configure multiple paths, repeat this operation.

      Figure 2 Manually configuring log collection paths

  4. Click Confirm.

Viewing VM Logs

After the log collection paths are configured, the ICAgent collects log files from them. This operation takes about 1 minute to complete. After collecting logs, you can perform the following operations:

  • Viewing VM Log Files

    In the navigation pane, choose Log Analysis > Log Files. Click the Host tab to view the collected log files. For details, see Checking Log Files.

  • Viewing and Analyzing VM logs

    In the navigation pane, choose Log Analysis > Log Search. Click the Host tab to view and analyze the collected logs by time range, keyword, and context. For details, see Searching for Logs.