Core Concepts
Master the fundamental building blocks of Vestig logging.
Overview
Vestig is built around a few core concepts that make logging both powerful and intuitive:
- Structured Logging — JSON-based log entries with rich metadata
- Log Levels — Fine-grained control over what gets logged
- Child Loggers — Namespaced loggers for organized output
Quick Start
typescript
Core Topics
Logging Basics
Learn how to create loggers and structure your log output effectively.
- Creating loggers with
createLogger() - Using the default
loginstance - Adding metadata to log entries
- Understanding log entry structure
Log Levels
Understand the log level hierarchy and when to use each level.
- Level hierarchy:
trace→debug→info→warn→error - Setting minimum log levels
- Level-based filtering
- Environment-specific configurations
Structured Output
Configure how your logs are formatted and displayed.
- JSON vs human-readable output
- Custom formatters
- Console styling and colors
- Production vs development formats
Child Loggers
Create scoped loggers with namespaces and inherited context.
- Creating child loggers with
log.child() - Namespace hierarchies
- Context inheritance
- When to use child loggers
Next Steps
- Tracing — Add distributed tracing with spans
- Transports — Send logs to different destinations
- Sampling — Control log volume in production