- Zero dependencies — nothing to install, nothing to break
- Simple API —
logger.info(),logger.warn(),logger.error() - Flexible formatting — plain text or structured JSON
- Multiple transports — Console, File (rotation + compression), HTTP (with retry)
- Child loggers — scoped logging for modules or requests
- Async mode — non-blocking writes for high-throughput apps
- Customizable — custom log levels, colors, and filters
We provide official adapters to easily integrate Zario into your favorite web frameworks:
- zario-express — Express logging middleware.
- nestjs-zario — NestJS custom logger service.
- fastify-zario — Fastify custom logger wrapper.
To ensure a fair and objective evaluation, we benchmarked Zario against Winston and Pino under identical conditions:
- Bundle Size: Measured using
esbuildto bundle and minify a minimal setup importing each package and performing a single logging operation. - Performance: Measured by logging 100,000 iterations to a shared Node.js
Writablenull stream (to isolate formatting and framework overhead from system I/O latency).
| Metric / Feature | Zario (Lean) | Zario (Full) | Pino | Winston |
|---|---|---|---|---|
| Bundle Size (Minified) | 11.80 KB | 24.72 KB | 60.65 KB | 143.92 KB |
| Speed (Simple Log) | 586k ops/sec | 586k ops/sec | 942k ops/sec | 177k ops/sec |
| Speed (With Metadata) | 391k ops/sec | 391k ops/sec | 839k ops/sec | 110k ops/sec |
| Runtime Dependencies | 0 | 0 | 8+ | 10+ |
| Resilience Transports | Built-in (via setup) | Built-in (out-of-the-box) | Needs custom streams | Needs custom transports |
| Tree-shakeability | Yes | Yes | No | No |
npm install zarioimport { Logger, ConsoleTransport } from "zario";
const logger = new Logger({
level: "info",
colorize: true,
transports: [new ConsoleTransport()],
prefix: "[MyApp]",
});
logger.info("Server started on port 3000");
logger.warn("High memory usage detected");
logger.error("Database connection failed", { code: 500 });const requestLogger = logger.createChild({
context: { scope: "request" },
});
requestLogger.info("Incoming request");import { Logger, ConsoleTransport } from "zario";
const jsonLogger = new Logger({
json: true,
transports: [new ConsoleTransport()],
});import { Logger, FileTransport } from "zario";
const logger = new Logger({
transports: [
new FileTransport({
path: "./logs/app.log",
maxSize: 10 * 1024 * 1024,
maxFiles: 5,
}),
],
});If you only need the core logger:
import { Logger } from "zario/logger";| Section | Description |
|---|---|
| Configuration | Logger options, custom levels, and colors |
| API Reference | Logger class and utilities |
| Transports | Console, File, HTTP, CircuitBreaker, DeadLetterQueue |
| Advanced Usage | Filters, enrichers, aggregators, async mode |
| Log Formats | Text and JSON output spec |
| Benchmarks | Performance comparison with other libraries |
| Roadmap | Future plans |
Bug reports, feature requests, and pull requests welcome. See Contributing Guide.
Star this repository if you find it useful
