Why AI Agents Need Logs
When debugging or developing multi-container applications, AI agents need access to real-time logs from all running services. docker-agent-tail provides structured JSONL log output with normalized levels that AI agents can easily parse and analyze.Claude Code Integration
Use docker-agent-tail to provide real-time logs to Claude Code:Set up agent config
Run
init to create CLAUDE.md instructions, .mcp.json, and agent-specific skill/rule files:Cursor Integration
Similar to Claude Code, you can use docker-agent-tail with Cursor:Best Practices
Filter Noisy Logs
Use
--exclude and --mute to reduce noise in logs shared with AI agents. This helps them focus on meaningful errors and warnings.Query Logs with lnav
Agents can use
lnav -n -c to run SQL queries against logs without an interactive terminal.Recent Logs Only
Use
--since to only capture recent logs, reducing file size and improving agent performance.Specific Services
Tail only the containers relevant to debugging to avoid overwhelming the agent with irrelevant logs.
Log Format for Agents
docker-agent-tail writes structured JSONL logs designed for easy parsing by AI agents:ts: ISO 8601 timestamp for correlating events across containerscontainer: Container name for filteringstream:stdoutorstderrlevel: Normalized log level (when detected from structured JSON)message: Log content (plain text) or original fields (structured JSON)
Example: Debugging a Failing Deploy
Here’s a typical workflow for using docker-agent-tail with an AI agent:You notice errors
Your web service is crashing on startup. You ask the AI agent for help:“My web service is crashing on startup. Can you help me debug?”
Share with the AI agent
“I’ve got logs streaming to logs/latest/. Can you read logs/latest/combined.jsonl and tell me what’s going wrong?”
For more details on CLI options, see the CLI reference. For interactive log analysis, see the lnav integration.