The log analysis feature enables you to accurately identify business exceptions for your application based on business logs.

Prerequisites

  • The application is monitored by Application Real-Time Monitoring Service (ARMS). For more information, see Overview.
  • Log Service is activated. If Log Service is not activated, log on to the Log Service console and activate Log Service by following the on-screen instructions.
  • A Log Service project is created. For more information, see Create a project.
  • A Log Service Logstore is created. For more information, see Create a Logstore.

Step 1: Associate business logs with trace IDs

  1. Log on to the ARMS console.
  2. In the left-side navigation pane, choose Application Monitoring > Applications. In the top navigation bar, select a region. On the Applications page, click the name of the application.
  3. In the left-side navigation pane, click Application Settings. On the page that appears, click the Custom Configuration tab.
  4. On the Custom Configuration tab, turn on Link Business Logs with TraceId in the Business Log Linking Settings section. Then, specify the project and Logstore that store the business logs to be associated with trace IDs.
    Link Business Logs with TraceId
  5. On the Custom Configuration tab, click Save in the lower-left corner.

Step 2: Query and analyze business logs

  1. Log on to the ARMS console.
  2. In the left-side navigation pane, choose Application Monitoring > Applications. In the top navigation bar, select a region. On the Applications page, click the name of the application.
  3. In the left-side navigation pane, choose 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 the time range for the query and analysis.
      You can select a relative time, set a time frame, or customize a time range.
      Note The query results may contain logs that are generated 1 minute earlier or later than the specified time range.
    3. Click Search & Analyze to view the query and analysis results.
    Log Analysis