Log Configuration
Configure logging through yourconfig.yaml or environment variables.
Configuration Options
Based on the source code (source:observability/config.go:12 and observability/log/global.go:33), the logger supports:
config.yaml
Log Levels
debug
debug
Use for: Development and detailed troubleshootingIncludes verbose information about:
- Message routing and processing
- Duty scheduling details
- Network events and peer connections
- Consensus round details
- Cache hits/misses
info
info
Use for: Production monitoring (recommended)Includes:
- Node startup and shutdown events
- Validator lifecycle events
- Duty handler start/stop
- Successful duty submissions
- Network connection status
- Important state changes
warn
warn
Use for: Highlighting potential issuesIncludes:
- Validator not found warnings
- Misaligned slot and duty timing
- Subscription channel congestion
- Recoverable errors
- Performance degradation signals
error
error
Use for: Tracking operational failuresIncludes:
- Failed duty submissions
- Beacon node connection failures
- Database operation errors
- Validator errors
- Message processing failures
Error-level logs indicate issues requiring operator attention.
fatal
fatal
Use for: Critical failures that stop the nodeIncludes:
- Panic recovery events with stack traces
- Unrecoverable initialization failures
- Critical configuration errors
Log Formats
JSON Format (Production)
Structured logs suitable for log aggregation and analysis.Console Format (Development)
Human-readable format for local development.Level Format Options
Based on source:observability/log/global.go:20
capital:INFO,ERROR,DEBUG(default)capitalColor: Colored level names (useful for console viewing)lowercase:info,error,debug
File Output Configuration
SSV Node supports rotating log files using [lumberjack](source:observability/log/global.go:109).
config.yaml
- New file created when size exceeds
LogFileSizeMB - Keeps
LogFileBackupsnumber of old files - Old files retained for 28 days maximum
- Files are not compressed by default
When file output is configured, logs are written to both stdout and the log file. The file always contains all log levels (debug and above) regardless of the
LogLevel setting.Log Fields and Context
SSV Node uses structured logging with consistent field names across the codebase.Standard Log Fields
Based on source:observability/log/fields/fields.go and log examples:
| Field Name | Description | Example |
|---|---|---|
epoch | Beacon chain epoch | {"epoch": 12345} |
slot | Beacon chain slot | {"slot": 394560} |
validator | Validator public key (hex) | {"validator": "0x8234...abcd"} |
duty_id | Unique duty identifier | {"duty_id": "..."} |
role | Validator duty role | {"role": "ATTESTER"} |
address | Network address | {"address": "0.0.0.0:15000"} |
name | Logger component name | {"name": "ssv.operator.duties"} |
caller | Source file and line | {"caller": "attester.go:145"} |
Component Names
Logger names follow a hierarchical pattern (source:observability/log/names.go):
ssv.observability- Observability systemssv.operator.duties- Duty handlersssv.operator.duties.attester- Attester duty handlerssv.operator.duties.proposer- Proposer duty handlerssv.operator.duties.committee- Sync committee handler
ssv.operator.validator- Validator lifecycle managementssv.runner- Duty execution runnersssv.api- API serverssv.metrics- Metrics handler
Log Examples
Startup Logs
Duty Execution Logs
Reorg and Index Change Events
Warning Logs
Error Logs
Log Analysis
Using jq for JSON Logs
Filter and analyze JSON-formatted logs:Using grep for Pattern Matching
Log Aggregation with Grafana Loki
Example LogQL queries:Common Log Patterns
Normal Operation
Beacon Node Connectivity Issues
Persistent beacon node errors indicate network connectivity or beacon node availability issues. Check your beacon node endpoint configuration.
Performance Degradation
Chain Reorg Events
Logging Best Practices
Production: Use JSON
Always use JSON format in production for easier parsing and integration with log aggregation tools.
Set Appropriate Level
Use
info level for production. Enable debug only when troubleshooting specific issues.Implement Log Rotation
Configure file output with rotation to prevent disk space exhaustion.
Monitor Error Rates
Track error log frequency as a key health indicator. Sudden increases warrant investigation.
Log Retention Recommendations
- Production: Retain 7-30 days of logs
- Development: 1-7 days sufficient
- Compliance: Adjust based on regulatory requirements
Privacy Considerations
Next Steps
Prometheus Metrics
Set up Prometheus metrics for quantitative monitoring
Troubleshooting Guide
Debug common issues using logs and metrics
