All Products
Search
Document Center

:Log analysis

Last Updated:Jun 20, 2026

Use log analysis to pinpoint the cause of business exceptions in your application. You can analyze logs from Simple Log Service (SLS) or logs collected directly. This topic describes how to enable log analysis and use it to analyze logs from SLS.

Prerequisites

Try in Playground

Alibaba Cloud Playground provides a demo environment where you can experience the main features of Cloud Monitor 2.0.

  1. Visit the Playground Demo. The default workspace opens.

  2. In the left-side navigation pane, choose All Features > O&M and Monitoring > ARMS.

  3. On the Applications page, click the target Application Name. In the left-side navigation pane, click Trace Analysis.

Step 1: Associate business logs

  1. Log on to the Cloud Monitor 2.0 console, and select a workspace. In the left navigation pane, choose Application Center > Application Observability > Application Insights.

  2. On the Applications page, click your target Application Name. In the left-side navigation pane, choose Application Configuration > Custom Configurations.

  3. On the Custom Configurations tab, in the Application Log Association section, turn on the Associate Business Logs with Trace ID switch. Select the region for your project, and then associate the project and Logstore.

  4. In the lower-left corner of the Custom Configurations tab, click Save.

Step 2: Query and analyze logs

  1. Log on to the Cloud Monitor 2.0 console, and select a workspace. In the left navigation pane, choose Application Center > Application Observability > Application Insights.

  2. On the Applications page, click your target Application Name. In the left-side navigation pane, click Trace Analysis.

  3. In the Actions column for the target trace, click Log.

  4. On the log query page, you can:

    1. In the search box, enter a query and analysis statement.

      A query and analysis statement uses the format Query statement|Analysis statement. For more information about the syntax, see Query syntax and functions and SQL analysis syntax.

    2. Set the time range for the query and analysis.

      You can set relative time, aligned time, or a custom time range.

      Note

      The query results may have a margin of error of up to 1 minute.

    3. Click Search & Analyze to view the results.

    After you filter logs by Trace ID, the query results show a RegisterPromClusterServlet Failed error log. The exception type is java.lang.RuntimeException, the root cause is Failed to create Grafana folder, and the stack trace indicates GrafanaConfigService.java.

References

You can associate a Trace ID from a trace with your application's business logs. This helps you quickly correlate business logs with a trace when an issue occurs and accelerates problem identification, analysis, and resolution. For detailed instructions, see Associate a Trace ID with business logs for a Java application.