Structured Output
JSON logging for production environments.
Overview
Vestig supports two output formats:
| Format | Best For | Output |
|---|---|---|
| Pretty | Development | Colored, human-readable |
| Structured | Production | JSON, machine-parseable |
Automatic Detection
By default, Vestig auto-detects the best format:
typescript
Forcing Structured Mode
typescript
Or via environment:
bash
JSON Output Format
typescript
Produces:
json
Pretty Output Format
In development, logs are formatted for readability:
text
With colors:
TRACE— GrayDEBUG— CyanINFO— GreenWARN— YellowERROR— Red
ConsoleTransport Options
Fine-tune console output:
typescript
Log Aggregation
Structured logs are designed for log aggregation services:
Datadog
json
CloudWatch
json
ELK Stack
json
Serialization
Errors
Errors are automatically serialized:
typescript
json
Circular References
Circular references are handled:
typescript
BigInt and Symbols
Special types are converted:
typescript