Skip to main content

Logs

WASP uses structlog for structured logging with ISO timestamps. All containers write to Docker's logging driver, accessible via docker compose logs.

Log Format

2026-03-09T18:57:48.037422Z [info] scheduler.job_complete job=goal_tick ms=2 success=True
2026-03-09T18:58:01.473396Z [info] scheduler.job_complete job=agent_tick ms=104 success=True
2026-03-09T18:59:16.800123Z [info] agent_core.skill_executed skill=web_search duration_ms=1243

Format: timestamp [level] event_name key=value key2=value2

Viewing Logs

# All services
docker compose logs -f

# Specific service
docker compose logs agent-core -f

# Last N lines
docker compose logs agent-core --tail=100

# Last 20 minutes
docker compose logs agent-core --since=20m

# Errors only
docker compose logs agent-core 2>&1 | grep "\[error\]"

Log Levels

LevelWhen Used
DEBUGDetailed trace information (disabled by default)
INFONormal operation events
WARNINGNon-critical issues, degraded functionality
ERRORFailures requiring attention
CRITICALFatal errors causing shutdown

Set log level:

LOG_LEVEL=DEBUG docker compose up -d agent-core

Key Log Events

Startup Events

EventDescription
agent_core.startingCore startup initiated
agent_core.db_initializedPostgreSQL connected, tables created
agent_core.models_initializedAI providers configured
agent_core.skills_initialized count=NN skills registered
agent_core.scheduler_startedAll 23 jobs registered
agent_core.readyEvent loop running, ready for messages
agent_core.plan_critic_initializedPlanCritic wired

Request Events

EventDescription
event_handler.message_received chat_id=...Message received from stream
event_handler.skill_call skill=... round=NSkill being called in round N
event_handler.skill_complete skill=... ms=NSkill completed
event_handler.response_sent tokens=NResponse dispatched
model_manager.overflow_recoveredContext overflow handled

Scheduler Events

EventDescription
scheduler.job_complete job=X ms=N success=True/FalseJob finished
scheduler.job_error job=X error=...Job failed with exception
dream.activatedDream mode started
autonomous.goal_created objective=...Proactive goal created
perception.alert_sent entity=BTC change_pct=5.2Price alert sent
behavioral_learner.rule_created type=hallucinationNew behavioral rule

Goal Engine Events

EventDescription
goal_orchestrator.goal_created id=...New goal created
goal_orchestrator.planning_started id=...PlanGenerator running
goal_orchestrator.plan_generated tasks=NTaskGraph ready
plan_critic.rejected issues=2Critic rejected plan
goal_orchestrator.goal_completed id=...Goal finished
goal_orchestrator.goal_failed reason=budget_exceededGoal failed

Health Events

EventDescription
health_monitor.check_complete score=95Health check done
self_healer.disk_cleanup freed_mb=250Disk cleanup triggered
self_healer.ollama_restartedOllama service restarted

Persistent Logs

Logs are persisted to /home/agent/data/logs/ via Docker volume:

ls /home/agent/data/logs/
# agent-core.log agent-telegram.log ...

Log Rotation

Docker's default logging does not rotate. For production, configure:

# docker-compose.yml
services:
agent-core:
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"

Audit Log (PostgreSQL)

The audit_log table provides durable, queryable logging of all skill calls:

# View recent skill calls
docker exec agent-postgres psql -U agent -d agent -c "
SELECT skill_name, capability_level, duration_ms, created_at
FROM audit_log
ORDER BY created_at DESC
LIMIT 30;
"

# Count by skill
docker exec agent-postgres psql -U agent -d agent -c "
SELECT skill_name, COUNT(*) as calls, AVG(duration_ms)::int as avg_ms
FROM audit_log
WHERE created_at > NOW() - INTERVAL '24 hours'
GROUP BY skill_name
ORDER BY calls DESC;
"

# Find errors
docker exec agent-postgres psql -U agent -d agent -c "
SELECT skill_name, output_summary, created_at
FROM audit_log
WHERE output_summary LIKE '%error%'
ORDER BY created_at DESC
LIMIT 20;
"

Enabling Debug Logging

For troubleshooting, enable DEBUG logs:

# Temporarily
docker exec agent-core bash -c "LOG_LEVEL=DEBUG python -m src.main"

# Permanently (requires restart)
LOG_LEVEL=DEBUG docker compose up -d agent-core

Debug logs include:

  • Full context content before LLM calls
  • Redis read/write operations
  • Detailed skill execution steps
  • Memory retrieval results