eltmon

pan-logs

View and analyze agent and system logs

eltmon 31 1 Updated 4w ago
GitHub

Install

npx skillscat add eltmon/overdeck/pan-logs

Install via the SkillsCat registry.

SKILL.md

View Logs

Overview

This skill guides you through viewing, filtering, and analyzing logs from agents, the dashboard, and system components.

When to Use

  • Debugging agent behavior
  • Troubleshooting errors
  • Monitoring system activity
  • Auditing agent actions
  • Post-mortem analysis

Quick Commands

# View agent output
tmux capture-pane -t agent-ISSUE-123 -p | tail -100

# View dashboard logs
cat ~/.overdeck/logs/dashboard.log

# View an issue's agent state and recent pipeline journal entries
pan show ISSUE-123

Agent Logs

Live Output

# Watch agent in real-time (Ctrl+b d to detach)
tmux attach -t agent-ISSUE-123

# Or stream output without attaching
while true; do
  tmux capture-pane -t agent-ISSUE-123 -p | tail -1
  sleep 1
done

Capture Full Session

# Capture entire scrollback buffer
tmux capture-pane -t agent-ISSUE-123 -p -S - > agent-full-output.txt

# Capture with timestamps (requires configuration)
tmux capture-pane -t agent-ISSUE-123 -p -e > agent-output-with-escapes.txt

Search Agent Output

# Search for errors
tmux capture-pane -t agent-ISSUE-123 -p -S - | grep -i error

# Search for tool calls
tmux capture-pane -t agent-ISSUE-123 -p -S - | grep -E "(Read|Write|Edit|Bash)"

# Search for specific patterns
tmux capture-pane -t agent-ISSUE-123 -p -S - | grep "TODO"

Multiple Agents

# Capture all agents
for session in $(tmux list-sessions -F "#{session_name}" | grep "^agent-"); do
  echo "=== $session ===" > logs/${session}.txt
  tmux capture-pane -t $session -p -S - >> logs/${session}.txt
done

Dashboard Logs

Server Logs

# If running in foreground, logs go to stdout
# If running as background process:
cat ~/.overdeck/logs/server.log

# Tail live
tail -f ~/.overdeck/logs/server.log

API Requests

# Filter API calls
grep "POST\|GET\|PUT\|DELETE" ~/.overdeck/logs/server.log

# Filter by endpoint
grep "/api/agents" ~/.overdeck/logs/server.log

System Logs

Overdeck Commands

# Command history (if configured)
cat ~/.overdeck/logs/commands.log

# Or check shell history
history | grep "pan "

Docker Logs (if using)

# Traefik logs
docker logs traefik --tail 100

# All container logs
docker compose logs --tail 50

Log Levels

When viewing logs, look for:

Level Indicates
ERROR Something failed, needs attention
WARN Potential issues, may need monitoring
INFO Normal operations
DEBUG Detailed diagnostic info

Log Analysis

Count Errors

# Count errors per agent
for session in $(tmux list-sessions -F "#{session_name}" | grep "^agent-"); do
  count=$(tmux capture-pane -t $session -p -S - | grep -ci error)
  echo "$session: $count errors"
done

Timeline of Actions

# If logs have timestamps, extract timeline
grep -E "^\[.*\]" agent-output.txt | head -50

Tool Usage Analysis

# Count tool calls by type
tmux capture-pane -t agent-ISSUE-123 -p -S - | \
  grep -oE "(Read|Write|Edit|Bash|Grep|Glob)" | \
  sort | uniq -c | sort -rn

Log Retention

Save Important Logs

# Create log archive for an issue
mkdir -p ~/.overdeck/archives/ISSUE-123
tmux capture-pane -t agent-ISSUE-123 -p -S - > ~/.overdeck/archives/ISSUE-123/agent.log
cp workspace/.pan/continue.json ~/.overdeck/archives/ISSUE-123/
git -C workspace log --oneline -20 > ~/.overdeck/archives/ISSUE-123/commits.log

Clean Old Logs

# Remove logs older than 7 days
find ~/.overdeck/logs -type f -mtime +7 -delete

# Archive and compress old logs
tar -czf logs-archive-$(date +%Y%m%d).tar.gz ~/.overdeck/logs/*.log

Configuring Log Output

Enable tmux Logging

Add to ~/.tmux.conf:

# Automatic logging
set -g history-limit 50000

Dashboard Logging

In dashboard config:

// Enable verbose logging
LOG_LEVEL=debug
LOG_FILE=~/.overdeck/logs/dashboard.log

Troubleshooting

No Output from Agent

# Check if session exists
tmux has-session -t agent-ISSUE-123

# Try capturing with different parameters
tmux capture-pane -t agent-ISSUE-123 -p -J

# Check if there's a specific window/pane
tmux list-panes -t agent-ISSUE-123

Logs Too Large

# Truncate log file
> ~/.overdeck/logs/server.log

# Rotate logs
mv server.log server.log.1

Missing Timestamps

# Add timestamps when capturing
tmux capture-pane -t agent-ISSUE-123 -p -S - | \
  while IFS= read -r line; do
    echo "[$(date '+%Y-%m-%d %H:%M:%S')] $line"
  done

Related Skills

  • /pan:diagnose - Troubleshooting
  • /pan:health - System health check
  • /pan:status - Agent status