When troubleshooting request failures, analyzing traffic patterns, or auditing access across your service mesh, you need visibility into what your gateways and sidecar proxies handle. Service Mesh (ASM) provides Log Center that allows you to view control-plane logs and data-plane logs in the ASM console. After you enable data-plane log collection, access logs from gateways and sidecar proxies are sent to Simple Log Service (SLS), where you can query logs, view traffic dashboards, configure log-based alerting rules, and view related dashboards.
Prerequisites
Before you begin, make sure that you have:
An Alibaba Cloud account with Simple Log Service (SLS) activated
The logtail-ds component installed in the data-plane cluster -- see Install Logtail
An ASM instance running version 1.17.2.35 or later with at least one cluster added -- see Add a cluster to an ASM instance and Update an ASM instance
ASM does not charge for log collection. SLS bills separately in either pay-by-feature or pay-by-ingested-data mode. For details, see SLS billing overview.
Enable log collection
ASM supports two independent data-plane log types:
| Log type | What it captures |
|---|---|
| ASM gateway logs | Access logs from ASM gateways |
| Sidecar proxy logs | Access logs from sidecar proxies attached to your workloads |
Enable each log type separately:
Log in to the ASM console.
In the left-side navigation pane, choose Service Mesh > Mesh Management.
On the Mesh Management page, click the name of your ASM instance.
In the left-side navigation pane, choose Observability Management Center > Log Center.
On the Log Center page, enable the log type you need:
Gateway logs -- Click Data-Plane Logs > ASM Gateway Logs or Data-Plane Log Dashboard > Gateway Dashboards. Specify AccessLogGatewayLifecycle, then click Enable Gateway Log Collection. In the Submit confirmation, click OK.
Sidecar proxy logs -- Click Data-Plane Logs > Sidecar Proxy Logs or Data-Plane Log Dashboard > Sidecar Proxy Dashboards. Specify AccessLogSidecarLifecycle, then click Enable Sidecar Log Collection. In the Submit confirmation, click OK.
To disable log collection, you can disable it in the upper-right corner of the corresponding tab.
View and analyze data-plane logs
After log collection is enabled, access logs flow into SLS automatically. Use Log Center to query, visualize, and monitor this data.
| Task | Where to go |
|---|---|
| Search and browse access logs | Log Center > Data-Plane Logs tab > ASM Gateway Logs or Sidecar Proxy Logs |
| View traffic dashboards | Log Center > Data-Plane Log Dashboard tab > Gateway Dashboards or Sidecar Proxy Dashboards |
Modify the data-plane log project
To change the SLS project that stores data-plane logs:
Log in to the ASM console.
In the left-side navigation pane, choose Service Mesh > Mesh Management.
Click the name of your ASM instance, then choose Observability Management Center > Log Center.
On either the Data-Plane Logs or Data-Plane Log Dashboard tab, click Modify next to Data Plane Log Project.
In the Modify Data Plane Log Project dialog box, update the project settings and click Save Settings.