Overview
Cloud Development provides developers with robust log search and management capabilities, helping them perform application debugging, issue troubleshooting, and performance monitoring more efficiently.
Core Advantages
- Flexible Log Printing: Using the Cloud Development SDK to customize print logs, supporting structured log output
- Diverse Search Methods: Supports full-text search, key-value search, fuzzy keyword search
- Rich Query Syntax: Provides various query syntaxes to meet different scenario requirements
- Real-time Log Monitoring: Monitor application runtime status in real time and quickly locate issues
Features
🖨️ Custom Log Printing
Compared to the traditional console object, Cloud Development provides a more powerful custom log feature:
- Multi-level Logging: Supports four log levels:
log,info,warn,error - Structured Output: Automatically add fields to log content and build key-value indexes
- Enhanced Information: Automatically adds key information such as timestamp, request ID, etc.
- Performance Optimization: Compared to the native console, provides better performance and controllability
Please refer to Log Printing for detailed usage.
🔍 Intelligent Log Search
Provides multiple flexible log search methods to meet the needs of different scenarios:
| Search Method | Applicable Scenarios | Features |
|---|---|---|
| Full-text search | Quickly locate key information | Supports keyword full-text search |
| Key-value search | Precisely locate structured data | Supports key:value format queries |
| Fuzzy Matching | Use when keywords are uncertain | Intelligent fuzzy matching algorithm |
| Advanced Syntax | Complex query requirements | Supports combining multiple query syntaxes |
Please refer to Log Search for detailed search methods.
📊 Service Invocation Log
In addition to traditional cloud function and cloud hosting logs, a new service invocation log type is added:
- Full-link Tracing: Records the complete invocation chain of accessing cloud development services via SDK or HTTP.
- Performance Monitoring: Monitor response times and success rates of service invocations
- Problem Locating: Quickly locate exceptions and errors occurring in service invocations
- Statistical Analysis: Provides statistics on service usage
For details, see Service Invocation Log.
Technical Principles
To improve search efficiency and accuracy, the Cloud Development log service employs intelligent tokenization mechanisms and case-sensitive matching to precisely pinpoint log information entered by users.
Token Delimiters
The raw log text will be split into multiple keywords based on token delimiters. The default delimiters for Cloud Development are !@#%^&*()_="', <>/?|\;:\n\t\r[]{}. Take the following log content as an example:
10002345987;write;ERROR;code=400;topic does not exist;
In the above log content, the two default token delimiters ; and = will split the log content into 6 words: 10002345987, write, ERROR, code, 400, topic does not exist. In precise search, users only need to enter any one of the words to retrieve this log entry.
- Because the requestId in Log Default System Fields contains hyphens, the hyphen (-) is not included in the default token delimiters.
- For user logs tokenized by delimiters, each tokenized segment must not exceed 32KB.
Case Sensitivity
Cloud Development log search is case-sensitive by default. For example, in the log content example above, the log has been split into 6 words: 10002345987, write, ERROR, code, 400, topic does not exist. To precisely search for logs containing the keyword ERROR, enter ERROR in the console.
If you enter error or Error in the console, you cannot retrieve logs containing ERROR.