Log Management
Log Management provides a unified entry point for viewing runtime logs of resources in a CloudBase environment. You can filter logs by resource type, time range, and log type, and use the search syntax to quickly locate issues.
Access
- Sign in to the CloudBase platform and select the target environment.
- Select Log Monitoring in the left navigation pane.
- Select the Log Management tab at the top of the page.
Filters
The following filters are available at the top of the page:
| Filter | Description |
|---|---|
| Resource Type | Select the resource to view, such as cloud functions, databases, or HTTP gateway |
| Time Range | Preset ranges such as the last 3 days or last 7 days, or a custom time range |
| Log Type | Real-time logs / historical logs |
| Search Condition | Click "Add search condition" for fine-grained filtering |
Log List
Logs are listed in reverse chronological order. Taking cloud function logs as an example, the list contains the following fields:
| Field | Description |
|---|---|
| No. | Log sequence number |
| Log Time | When the log was generated; sortable |
| Log Content | Detailed log information, for example START RequestId: xxx |
| Invocation Status | Current invocation status |
| Function Name | Name of the cloud function that generated the log |
| Request ID | Unique identifier of the request |
| Function Version | Function version number, for example $LATEST |
The column settings and search controls in the upper-right corner let you adjust the displayed fields.
Searching Logs
Log Management supports three search methods:
| Method | Syntax | Use Case |
|---|---|---|
| Full-text search | Enter a keyword directly | Quickly locate logs containing a keyword |
| Key-value search | key:value | Precisely match structured fields |
| Fuzzy search | abc*, ab?c | Match when the keyword is incomplete |
Syntax notes:
- Use
a=bfor an exact match. - Use
a:bfor a contains match, which supports fuzzy search. - Search is case-sensitive by default. To match
ERROR, enter the keyword in uppercase.
For the full search syntax, tokenization rules, and examples, see Log Search.
Log Settings
To disable log recording:
- Sign in to the CloudBase console and select the target environment.
- Open Log Management > Log Settings in the left navigation pane.
- Select Delete logs and confirm.
After log recording is disabled, no new logs are generated. Existing historical logs remain searchable.
More Flexible Usage
The console is suitable for interactive viewing. For batch queries, scripting, or AI-based analysis, use the CloudBase CLI log search command:
# Search all logs from the last hour
tcb logs search -e <env-id>
# Filter by function name for the last 6 hours
tcb logs search -q 'function_name:"myFunc"' -t 6h -e <env-id>
For the full syntax and field reference, see CLI Log Search.
Related Capabilities
| Capability | Description | Documentation |
|---|---|---|
| Long-term log storage | Deliver logs to Tencent Cloud Log Service (CLS); logs can also be delivered back to CloudBase | Deliver Logs to CLS |
| Resource metrics | View invocation volume, latency distribution, and storage usage | Operations Monitoring |
| Automatic alerting | Configure alert policies based on monitoring metrics | Metric Alerts |
Notes
- After the log content is split by token delimiters, a single token cannot exceed 32KB.
- Monitoring and alerting rely on log and metric data, which is reported with some delay. Analyze data with an appropriate time window.