Home › IT ops & DevOps › Explain logs and errors: how to do it with AI
Explain logs and errors: how to do it with AI
From official vendor pages; selected tasks also include dated logged-out free-plan trials. Report an error.
Beginner Risk: Low 🛠️ IT ops & DevOps
Paste an error message or a slice of a log and an assistant suggests what probably went wrong and what to check next. It shortens the time between "something broke" and "I know where to look".
Who it’s for: Sysadmins, helpdesk staff, DevOps engineers and developers on call.
Why low risk: Reading logs changes nothing, but logs often contain usernames, IPs and tokens, and a wrong diagnosis can waste time.
ChatGPT has the highest score on our published rubric (94/100) of the 4 tools listed for this task. Free plan has unlimited text chats, enough for most error messages.
Step by step
- Copy the error plus about 20 lines before it, not the whole log file.
- Remove or mask tokens, passwords, IPs, hostnames and usernames.
- Say what the system is, what changed recently and what you already tried.
- Ask for the 3 most likely causes, ranked, with the evidence line for each.
- Ask for read-only commands to confirm each cause before any fix.
- Apply one fix at a time and note the result.
AI prompts to explain logs and error messages
Replace the [brackets] with your details. See all prompt examples
Here's an error from [system/version] after [recent change]. Give the 3 most likely causes, ranked, quoting the log line that supports each. Then give a read-only command to confirm each one. [paste masked log]
Explain this error in plain words: what component raised it, what it was trying to do, and what usually causes it. Don't suggest fixes yet. [paste]
Using this log and what we found ([findings]), write a short incident note: what happened, impact, root cause, fix, and one prevention step.
Illustrative example
You paste
nginx on Ubuntu, started after a config change: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
A good answer looks like
Most likely: another process already uses port 80 (often a second nginx or Apache). Confirm (read-only): sudo ss -ltnp | grep ':80' If it's Apache: decide which server should own port 80 before stopping anything. Less likely: a duplicate listen 80 line in your new config. Check with: sudo nginx -t
Illustrative example written for this guide, not output captured from a specific tool.
Safe practice
- Run anything that changes systems in a test VM or lab tenant first, never straight on production.
- Use a least-privilege account: only the rights the task needs, not Domain Admin or Global Administrator.
- Never paste passwords, API keys, connection strings, tenant IDs with secrets, or client secrets into a chat. Use placeholders like <SECRET>.
- Read every command that modifies or deletes before you run it, and ask the AI to list those lines separately.
Which tool to pick, and why
- Claude (incl. Claude Code): Free plan includes files and code execution; you can upload a larger log file instead of pasting. Free plan can do this Visit official website ↗
- ChatGPT (incl. Work & Codex): Free plan has unlimited text chats, enough for most error messages. Free plan can do this Visit official website ↗
- Cursor: If the logs come from your own app, its agent can search the codebase for where the error is raised. Visit official website ↗
- GitHub Copilot: Free plan includes limited chat and agent usage inside your editor, next to the code that logged the error. Visit official website ↗
Reasons come from the capabilities, free-plan details and prices we've checked on official pages (separate from any dated trial above). Sources: claude.com/pricing · chatgpt.com/pricing · cursor.com/pricing · github.com/features/copilot/plans
Common mistakes
- Pasting a whole log with tokens and customer data in it.
- Running the first suggested fix without confirming the cause.
- Not mentioning what changed just before the error.
- Changing several things at once, so you can't tell what fixed it.
Privacy tip
Mask anything that identifies people or systems: usernames, emails, IPs, hostnames, session IDs and bearer tokens. Rotate any secret you pasted by mistake.
Claude (incl. Claude Code) setting · ChatGPT (incl. Work & Codex) setting · Cursor setting · Sources: privacy.claude.com/en/articles/12109829-how-do-i-change-my-model-improvement-privacy-settings · help.openai.com/en/articles/7730893-data-controls-in-chatgpt · cursor.com/help/security-and-privacy/privacy