Overview
CloudBase provides developers with more advanced log retrieval and management capabilities. Developers can use the SDK provided by CloudBase to customize printing logs and retrieve logs in multiple ways, such as full-text search, key-value search, fuzzy keyword search, and various query syntaxes.
Feature Overview
Print Logs
Compared to the original console object for printing logs, developers can use CloudBase custom logs, which also provide four log levels, such as log
, info
, warn
, and error
. Developer-customized log content automatically adds fields to logs and establishes key-value indexes. For details, see Print Logs.
Search Logs
Compared to the original single log viewing method, CloudBase provides developers with multiple ways to search log content, supporting both exact search and fuzzy keyword matching. It offers full-text keyword search and key-value pair search in the form of key:value, and supports various query syntaxes. For details, see Search Logs.
Service Invocation Logs
Compared to the existing log types of cloud functions and cloud hosting in the current log console, CloudBase provides developers with a new log type: service invocation logs. When accessing services via SDK or HTTP using CloudBase services, service invocation logs will be generated. For details, see Service Invocation Logs.
More Information
The original log text will be split into multiple keywords based on the delimiter, and case-sensitive matching will be used to precisely locate the log information entered by users.
Delimiter
The original log text will be split into multiple keywords based on delimiters. The default delimiters in CloudBase 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 delimiters ;
and =
split the content into six words: 10002345987
, write
, ERROR
, code
, 400
, and topic does not exist
. In exact search, users only need to enter any one word to find this log entry.
- Because the
requestid
in Default System Fields for Logs contains -, the - is not used as a default delimiter. - For user logs, each segment after tokenization using delimiters must not exceed 32KB.
Case-Sensitive
CloudBase log retrieval is case-sensitive by default. For example, in the above log content example, the log content is split into 6 words: 10002345987
, write
, ERROR
, code
, 400
, and topic does not exist
. To perform an exact search for logs containing the keyword ERROR, enter ERROR
in the console.
If you enter error
or Error
in the console, you will not be able to retrieve logs containing ERROR.