Fast • Lightweight • Zero Dependencies • TypeScript Native
📖 Documentation · ⚡ Quick Start · ✨ Features · 🤝 Contributing
- Lightweight — minimal footprint, fast execution
- Simple API — intuitive methods like
info(),warn(),error() - Flexible formatting — plain text or structured JSON
- Multiple transports — Console, File (streaming rotation), HTTP (async retry), CircuitBreaker, and DeadLetterQueue
- Child loggers — scoped logging for modules or requests
- Async mode — non-blocking writes for high-performance applications
- Memory safe — bounded queues and memory-efficient streaming
- Customizable — custom log levels, colors, and filtering
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,
}),
],
});
logger.info("This log is written to a file");Documentation:
| Section | Description |
|---|---|
| 📘 Introduction | Philosophy, core features, and common use cases. |
| 🚀 Getting Started | Detailed installation and environment auto-configuration. |
| ⚙️ Configuration | Full reference for all logger options, custom levels, and colors. |
| 📖 API Reference | Detailed API documentation for the Logger class and utilities. |
| 📁 Transports | Guide to Console, File, HTTP, CircuitBreaker, and DeadLetterQueue transports. |
| 🧩 Advanced Usage | Filters, Enrichers (Structured Logging), and Aggregators. |
| 📊 Log Formats | Specification for Text and JSON output formats. |
| 🗺️ Roadmap | Future plans and upcoming features. |
| 📊 Benchmarks | Performance comparison with other logging libraries. |
We welcome contributions! Whether it's bug reports, feature requests, or code contributions. Please see our Contributing Guide for more details.
This project is licensed under the MIT License - see the LICENSE file for full details.
