Log System Overview
Conway Automaton uses structured JSON logging for all operations. Logs are written to stdout in real-time and can be consumed by log aggregation systems.Log Format
Every log entry is a JSON object:Fields
- timestamp: ISO 8601 timestamp with milliseconds
- level: Log level (
debug,info,warn,error,fatal) - module: Hierarchical module name (e.g.,
agent.tools,conway.credits) - message: Human-readable message
- context: Structured data (optional)
- error: Error details (optional, for error/fatal levels)
Error Log Example
Log Levels
debug
Detailed diagnostic information for development and troubleshooting. Examples:- Tool argument parsing
- Database query execution
- Context token counting
- Heartbeat tick details
info
General informational messages about normal operation. Examples:- Agent turn completed
- Heartbeat task success
- Credit topup successful
- Skill loaded
warn
Warning messages for potentially problematic situations that don’t prevent operation. Examples:- Treasury policy limit reached
- Failed requirement check for skill
- High context token usage
- Approaching credit threshold
error
Error messages for operations that failed but didn’t crash the system. Examples:- Tool execution error
- API request failure
- x402 payment rejected
- Database transaction rollback
fatal
Critical errors that require system shutdown. Examples:- Database corruption
- Wallet file missing
- Unrecoverable API errors
- Configuration invalid
Viewing Logs
CLI Commands
Direct File Access
If running as a daemon, logs may be written to a file:Log Modules
From the source code structure:Core Modules
- config: Configuration loading and validation
- database: SQLite operations
- wallet: Wallet management
Agent Modules
- agent.loop: Main agent loop
- agent.tools: Tool execution
- agent.context: Context building
- agent.policy: Policy engine
Conway Modules
- conway.client: Conway API client
- conway.credits: Credit balance checks
- conway.topup: x402 credit purchases
- conway.inference: Model inference routing
Heartbeat Modules
- heartbeat.scheduler: Task scheduling
- heartbeat.daemon: Daemon process
- heartbeat.tasks: Task execution
Skills Modules
- skills.loader: Skill discovery and loading
- skills.registry: Skill management
Memory Modules
- memory.episodic: Episodic memory
- memory.semantic: Semantic memory
- memory.working: Working memory
- memory.compression: Context compression
Observability Modules
- observability.logger: Logging system
- observability.metrics: Metrics collection
- observability.alerts: Alert evaluation
Replication Modules
- replication.spawn: Child creation
- replication.health: Health monitoring
- replication.messaging: Inter-agent messaging
Reading Common Log Patterns
Agent Turn Execution
Credit Topup Flow
Heartbeat Task Execution
Policy Denial
Skill Loading
Log Analysis
Performance Analysis
Find slowest turns:Error Rate Calculation
Cost Analysis
Timeline Reconstruction
Configuring Log Level
Set log level inautomaton.json:
Log Level Hierarchy
Fromsrc/types.ts:
warn will show warn, error, and fatal messages.
Log Rotation
If using file-based logging, configure rotation:Integration with Log Aggregation
Shipping to Elasticsearch
CloudWatch Logs
Datadog
Debugging Techniques
Tracing a Specific Turn
Correlation by Timestamp
Following Module Activity
Extracting Error Context
Common Log Messages
Startup Sequence
Normal Operation
Low Credit Warning
Skill Installation
Error Scenarios
Best Practices
- Use appropriate log levels: Don’t log everything at
info - Include context: Add relevant data to context objects
- Never log secrets: Redact API keys, private keys, etc.
- Use structured context: Prefer context fields over string interpolation
- Consistent module naming: Follow the hierarchical pattern
- Log boundaries: Start/end of important operations
- Log decisions: Why did the agent do something?
- Keep messages concise: Details go in context