Log association

更新时间:
复制 MD 格式

Analyze business logs to pinpoint the cause of an application exception. This topic shows how to correlate logs from Simple Log Service (SLS) with traces in Managed Service for OpenTelemetry.

Prerequisites

Associate business logs with traces

Log sources

You need to collect application logs to Simple Log Service (SLS) and configure the binding between the application and a Project/Logstore in the log association configuration of Managed Service for OpenTelemetry. Managed Service for OpenTelemetry will then embed the Simple Log Service page to facilitate your log analysis.

Associate business logs

  1. Log on to the Managed Service for OpenTelemetry console.

  2. In the left-side navigation pane, choose System Configuration > Log Association. In the top menu bar, select the target region.

    Note

    The Log Association page lists applications that are associated with SLS logstores. In the Actions column, you can Edit or Delete an association.

  3. On the Log Association page, click Create to add an association between an application and an SLS logstore.

  4. In the Add Log Association dialog box, select the applications to associate, the Simple Log Service region, project, and logstore. Then, map the TraceId to the corresponding field in the logstore and click OK.

Query and analyze logs

  1. In the left-side navigation pane, click Trace Explorer.

  2. In the trace list, click Logs in the Actions column to view the business logs associated with the trace.