If an exception occurs in your application, you can use logs to accurately identify the exception. This topic describes how to associate logs in Simple Log Service with Trace Explorer of Managed Service for OpenTelemetry.
Prerequisites
The data of the application that you want to monitor is reported to Managed Service for OpenTelemetry. For more information, see Connection Description.
A Simple Log Service project is created. For more information, see the Create a project section of the "Manage a project" topic.
A Logstore is created. For more information, see the Create a Logstore section of the "Manage a Logstore" topic.
Trace data is collected and imported to Simple Log Service. For more information, see Data collection overview.
Associate logs with traces
Log sources
You need to collect application logs to Simple Log Service and associate the application with the Simple Log Service project and Logstore in the Managed Service for OpenTelemetry console. Pages of the Simple Log Service console are embedded in the Managed Service for OpenTelemetry console to help you analyze logs.
Associate business logs
Log on to the Managed Service for OpenTelemetry console.
In the left-side navigation pane, choose
. In the top navigation bar, select a region.NoteOn the Log Association page, view the applications that are associated with the Simple Log Service Logstore and the corresponding associations. You can click Edit or Delete in the Actions column to change or delete an association.
On the Log Association page, click Create to associate the application with the Simple Log Service Logstore.
In the Add Log Association dialog box, select one or more applications that you want to associate with the Logstore, configure the Region, Log Service Project, Log Service Logstore, and Associated Index parameters, and then click OK.
Query and analyze logs
In the left-side navigation pane, click Trace Explorer.
In the trace list, find the trace that you want to manage and click Logs in the Actions column. On the Log Query page, view the business logs that are associated with the trace.