# Log Analysis

Log Analysis performs intelligent analysis on model inference logs within a specified scope. It automatically identifies AI usage patterns of teams or individuals and generates structured reports covering activity distribution, primary tasks, risks, and recommendations — helping you understand actual AI usage and uncover potential issues.

A typical log analysis workflow includes the following steps:

1. Complete the basic settings: select the model for analysis tasks and configure activity categories;
2. Create an analysis task and select the log scope to analyze;
3. Wait for the task to complete in the background;
4. View or download the report, or re-analyze based on the original configuration.


## Prerequisites

Before using Log Analysis, ensure the following conditions are met:

- Inference logging is enabled for the current project;
- An API Key available for log analysis has been prepared, and the API Key has access to the required models;

If the Log Analysis entry is not displayed on the page, first check whether inference logging is enabled for the current project and whether the current account has the required feature permissions.

> **Data Security Notice** Log Analysis reads inference logs within the selected scope. These logs may contain personal information, business data, or other sensitive content. Before use, please confirm that the recording and analysis of such data comply with the data security and compliance requirements of you and your organization.


## Basic Settings

Before using Log Analysis for the first time, you need to complete the basic settings. Go to **Model Service Platform > Model Logs > Log Analysis**, click **Basic Settings**, and configure the following:

| Setting         | Description                                                                                                                  |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| API Key         | Used to call the preprocessing model, embedding model, and analysis model. The list shows API Keys accessible to the current account. |
| Preprocessing Model | Used to preprocess raw logs. Available options depend on the model permissions of the selected API Key.                     |
| Embedding Model | Used to vectorize log content and perform semantic aggregation. Available options depend on the model permissions of the selected API Key. |
| Analysis Model  | Used to perform in-depth analysis and generate report insights. Available options depend on the model permissions of the selected API Key. |
| Activity Categories | Used to classify activity types in logs according to a unified standard. It is recommended to adjust categories based on your actual business needs to make reports more relevant to your analysis goals. |

If no models are available for a specific analysis step under the selected API Key, switch to a different API Key or go to the Key Management page to enable the required model permissions.

Modifying the basic settings only affects subsequently submitted analysis tasks and does not change previously generated reports.

## Creating a Log Analysis

1. Go to **Model Service Platform > Model Logs > Log Analysis**.
2. Click **New Analysis** in the upper-right corner of the page.
3. Review the current analysis settings displayed on the page. To make changes, click **Edit Settings**.
4. Enter a report name and select the analysis scope.
5. Confirm and submit the task.


The task runs asynchronously in the background after submission.

Processing a large volume of logs may take a significant amount of time. It is recommended to check back later or the next day.

### Analysis Scope

All analysis conditions are combined using intersection — the system only analyzes logs that meet all conditions simultaneously.

Log Analysis has the following scope limitations:

- Only analyzes inference logs recorded under the selected project;
- Currently only supports analyzing model requests with successful responses;
- A single task can analyze up to 31 consecutive days of logs;
- Logs from the most recent 60 days can be selected;

The specific available models, log volume limits, and other restrictions are subject to what is displayed on the console page.


## Managing Analysis Tasks

You can view and manage historical tasks in the Log Analysis list.

Each task in the list includes the task name, status, analysis scope, creation time, and available actions.

### Task Status

| Status      | Description                                                                    |
| ----------- | ------------------------------------------------------------------------------ |
| Queued      | The task has been submitted and is waiting for the system to allocate execution resources. |
| Analyzing   | The system is processing logs and generating the report.                       |
| Succeeded   | The task is complete. You can view and download the report.                    |
| Failed      | The task execution failed. You can view the error details and re-analyze.      |
| Cancelled   | The task was cancelled by the user. You can copy the original configuration and re-analyze. |

### Re-analyze

Click **Re-analyze** to copy the original task configuration and open the creation page. You can submit directly or modify the report name, analysis scope, and other parameters before submitting.

A new analysis task is generated after resubmission. The original task and its report are not overwritten.

### Viewing Reports

After the task status changes to **Succeeded**, click **View** to open the report page.

Report content is generated by the model based on sampled logs and is intended for analysis and decision-making reference only. For important conclusions, it is recommended to verify further by combining business context and raw logs.

### Downloading Reports

On the report page, click **Download** to download the current analysis results as an HTML file.

Currently, only the analysis report page can be downloaded. Downloading raw sample logs along with the report is not supported. If you need to save raw logs, please retrieve and export them separately through Model Logs or the log service.



## Data Retention and Costs

- Log Analysis reports are retained for up to 60 days. Reports beyond the retention period may not be viewable or downloadable.
- Log Analysis calls the preprocessing model, embedding model, and analysis model, and charges are based on the actual usage of each model.
- Cancelling a running task does not reverse model calls and charges that have already been incurred.
- You can view the model usage and billing details generated by Log Analysis in **Model Service Platform > Model Logs** and **Billing Center**.


## FAQ

### Why can't I see the Log Analysis entry?

Please confirm that inference logging is enabled for the current project and that the current account has the Log Analysis feature permission for this project. If it is still not displayed, contact the project administrator to verify the permission configuration.

### Why are there no available analysis models?

The available models depend on the model permissions of the API Key selected in the basic settings. Try switching to a different API Key, or go to the Key Management page to enable the required model permissions.

### Why is the number of qualifying logs 0?

Please check the following in order:

1. Whether inference logs have been generated within the selected time range;
2. Whether inference logging was enabled before the model requests occurred;
3. Whether the API Key and model filter conditions are correct;
4. Whether the selected requests have successful responses;
5. Whether the logs are still within the retention period.

### Why isn't the report generated immediately after submission?

Log Analysis runs asynchronously. Tasks must go through queuing, log processing, and report generation in sequence. Execution time depends on log volume, sampling rate, model response time, and system load. You can leave the page and check the task status in the analysis list later.

### What should I do after a task fails?

Click **View Details** on the failed task to see the error code and failure reason. For issues related to model permissions, account status, or log scope, follow the prompts to resolve them, then click **Re-analyze**. Re-analyzing creates a new task and does not overwrite the original record.

### Will charges still be incurred after cancelling a task?

Possibly. Cancelling a queued task typically has not incurred any analysis costs. When cancelling a task that is already analyzing, model calls that have already been completed will be charged normally.

### Why does the number of logs covered in the report differ from the Model Logs page for the same time period?

The two may use different time ranges, filter conditions, retention periods, and counting methods. Log Analysis may also sample logs at a specific sampling rate and perform session consolidation and deduplication on requests.

### Can report content be used directly as final conclusions?

Not recommended. Reports are generated by models based on sampled logs and may be affected by sample scope, sampling rate, category configuration, and model capabilities. For risk assessments, personnel evaluations, or important business decisions, please perform manual verification by combining complete data and business context.
