| name | web-monitor-analyze-log |
| description | Web Monitor helper. Analyze service error logs and tracebacks to identify root cause, affected files, and a minimal fix.
|
Log Analysis Protocol
Input
- A traceback string or log file path
- Optional: service source code directory
Procedure
-
Parse the traceback
- Identify the exception type and message
- Note the file path and line number of the error
- Trace the call stack to find the origin
-
Read the code
Read the file at the error line
- Read 5 lines before and after for context
-
Determine root cause
- What precondition was violated?
- Was it missing input validation, wrong logic, type mismatch?
-
Propose fix
- Write a concise explanation
- Include a code snippet showing the proposed change
Output Format
## Error Summary
<one sentence>
## Root Cause
<2-3 sentences>
## Affected File(s)
- `path/to/file.py` line N
## Proposed Fix
```python
# before
...
# after
...
Confidence
High / Medium / Low