This skill enables intelligent log investigation across the Training & Certification (培训认证) platform's 6 CLS log environments. Given a bug description, requestId, error message, or keywords, it automatically searches the correct CLS topic, retrieves relevant logs, expands context around key entries, and provides a structured root-cause analysis.
Before using this skill, verify the Topic IDs below match the actual CLS environment. Update them if the team provisions new topics.
Read the Environment Configuration file to load the full topic mapping.
| Environment | Region Code | Topic ID |
|---|---|---|
| --- | --- | --- |
| 国内测试 (Domestic Test) | ap-guangzhou | 58d165d7-81c0-4d1c-b91e-41bae4df77a9 |
| 国内生产 (Domestic Prod) | ap-guangzhou | 5b962eb2-75ed-4ebb-9575-1c8bd12d1bde |
| 国内灰度 (Domestic Gray) | ap-guangzhou | ff716f84-0cc2-4411-9a70-b1cd099ff8b6 |
| 国际测试 (Intl Test) | ap-singapore | 32c91c6e-691c-4d4d-96b7-ba7f6f735dcf |
| 国际生产 (Intl Prod) | ap-singapore | d4274882-f7a8-43cc-b7fb-0b12c018fbb5 |
| 国际灰度 (Intl Gray) | ap-singapore | a5b0f47a-00e0-44f0-9c16-1cf5cbecc436 |
Follow this workflow for every log investigation request.
Extract from the user's request:
ap-guangzhou)ap-singapore)If the user mentions multiple environments (e.g., "查一下生产和灰度"), search both sequentially and present results together.
Based on Step 1, read references/env_config.md to look up the correct TopicId and Region code.
Construct the environment key as: {site}_{environment} (e.g., domestic_prod, intl_test).
Construct the CLS search query based on the extracted keywords:
For requestId / traceId searches:
requestId:"VALUE" OR traceId:"VALUE"
Replace VALUE with the actual requestId or traceId string.
For error message searches:
"error message text here"
Replace the quoted text with the actual error message.
For keyword-based searches:
keyword1 AND keyword2
Replace keyword1, keyword2 with the actual search terms.
For complex natural language queries:
Use the TextToSearchLogQuery MCP tool to convert the user's description into a valid CLS query. Parameters:
Text: the user's natural language descriptionRegion: resolved region codeTopicId: resolved topic IDCall the SearchLog MCP tool with:
Region: the resolved region code (e.g., ap-guangzhou)TopicId: the resolved topic IDFrom: start timestamp in milliseconds (use ConvertTimeStringToTimestamp to convert)To: end timestamp in millisecondsQuery: the constructed query stringLimit: start with 20 for initial search. Increase to 50-100 if needed.Sort: desc (newest first)Important: Always use ConvertTimeStringToTimestamp to get accurate timestamps. Calculate the time range first as ISO 8601 strings, then convert both From and To.
Time range guidelines:
After receiving search results:
DescribeLogContext to fetch surrounding logs (±10-20 lines) for full context:Region: same regionTopicId: same topic IDTime: from the log entry's Time fieldPkgId: from the log entry's PkgId fieldPkgLogId: from the log entry's PkgLogId fieldPrevLogs: 15NextLogs: 15Structure the output as:
## 🔍 日志排查报告
### 排查环境
- **站点**: 国内/国际
- **环境**: 测试/生产/灰度
- **时间范围**: YYYY-MM-DD HH:mm:ss ~ YYYY-MM-DD HH:mm:ss
- **搜索关键词**: xxx
### 关键发现
1. [Summary of the most important finding]
2. [Additional findings...]
### 关键日志条目
[Present the most relevant log entries with timestamps and context]
### 根因分析
[Based on the log evidence, provide root cause analysis]
### 建议
1. [Actionable recommendation based on findings]
2. [Additional recommendations...]
When the user asks to compare across environments or the initial search suggests cross-environment impact:
共 1 个版本