You can use the log analysis feature to accurately identify business exceptions on your application based on business logs. This topic describes how to use the log analysis feature.

Limits

Log analysis is supported only in Enterprise Distributed Application Service (EDAS) Professional Edition and Platinum Edition.

Step 1: Associate business logs with trace IDs

  1. Log on to the EDAS console.
  2. Go to the Application Overview page by using one of the following methods:
    • In the left-side navigation pane, choose Resource Management > Container Service Kubernetes Clusters or Resource Management > Serverless Kubernetes Clusters. In the top navigation bar, select a region. In the upper part of the page, select a microservice namespace. On the Container Service Kubernetes Clusters or Serverless Kubernetes Clusters page, click a cluster ID. In the Applications section of the Cluster Details page, click the name of the application that you want to manage.
    • 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 microservice namespace. 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.
  3. In the left-side navigation pane, choose Application Settings > Application Monitoring Settings.
  4. On the Application Monitoring Settings page, click the Custom Configuration tab.
  5. In the Business Log Linking Settings section, specify whether to associate the business logs of the application with trace IDs.
    Business log
    • If you turn on Link Business Logs with TraceId, trace IDs are automatically generated in the business logs.
    • To achieve precise positioning, you must bind projects and Logstores.
  6. On the Custom Configuration tab, click Save in the lower part.

Step 2: Query and analyze business logs

  1. Log on to the EDAS console.
  2. Go to the Application Overview page by using one of the following methods:
    • In the left-side navigation pane, choose Resource Management > Container Service Kubernetes Clusters or Resource Management > Serverless Kubernetes Clusters. In the top navigation bar, select a region. In the upper part of the page, select a microservice namespace. On the Container Service Kubernetes Clusters or Serverless Kubernetes Clusters page, click a cluster ID. In the Applications section of the Cluster Details page, click the name of the application that you want to manage.
    • 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 microservice namespace. 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.
  3. In the left-side navigation pane of the application details page, choose Monitor > Application Diagnosis-Log Analysis.
  4. On the Log Analysis page, perform the following operations:
    1. Enter a query statement in the search box.
      A query statement consists of a search statement and an analytic statement in the format of Search statement|Analytic statement. For more information, see Search syntax and SQL syntax and functions.
    2. Specify a time range for the query and analysis.
      You can select a relative time, set a time range, or customize a time range.
      Note The query results may contain logs that are generated 1 minute earlier or later than the time range that you specify.
    3. Click Search & Analyze to view the query and analysis results.
    Use the log analysis feature