Platform for AI (PAI) is integrated with ActionTrail, which records operations performed in your Alibaba Cloud account. By default, ActionTrail retains PAI event logs for 90 days. To store events beyond 90 days, create a trail to deliver them to Simple Log Service (SLS) or Object Storage Service (OSS) for long-term storage and analysis.
For the full list of PAI operations that ActionTrail records, see API Reference.
Query options
ActionTrail provides two ways to query PAI events:
| Method | Best for | Requirement |
|---|---|---|
| Basic query | Quick lookups within the last 90 days | None — use the ActionTrail console directly |
| Advanced query | Filtering by service, event name, or read/write type; SQL-based queries | A trail that delivers events to SLS |
Basic query
ActionTrail stores operation events for each Alibaba Cloud account for the last 90 days. Query these events directly in the ActionTrail console without any additional setup. For details, see Query events in the ActionTrail console.
Advanced query
Advanced query supports two modes: simple query mode for visual filtering, and SQL query mode for custom SQL conditions. Both modes require a trail that delivers events to SLS.
Before you begin
Make sure you have:
A trail that delivers events to Simple Log Service. To create one, see Create a single-account trail or Create a multi-account trail
Run an advanced query
Log on to the ActionTrail console.
In the navigation pane, choose Events > Advanced Event Query.
On the Default tab of the Custom Template page, configure your query conditions using simple query mode or SQL query mode.
Click Run. The Raw Logs tab displays the event logs that match your conditions.
In the event list, click View Event Details in the Actions column to view the basic information and event record for that event.
Simple query mode
In the upper-right corner of the page, turn on Simple Mode, then configure the following parameters:

| Parameter | Description |
|---|---|
| Service Name | Select Platform for AI (PAI). |
| Region | Select the region to query. Example: China (Hangzhou). |
| Event Name | Select the event to query. Example: StopJob. |
| Read/Write Type | Select Write(Write) or Read(Read). |
SQL query mode
If simple query mode does not meet your needs, switch to SQL query mode. Turn off Simple Mode — the conditions you configured in simple query mode are automatically converted into an SQL statement, which you can then customize.

For SQL syntax and sample queries, see SQL statements in advanced event queries.
What's next
To retain PAI events beyond 90 days, deliver them to SLS or OSS for long-term storage and analysis. See Create a single-account trail.
To view the full list of recordable PAI operations, see API Reference.