OCPP WS IOOCPP WS IO
VoltLog IO

Introduction

A modern, lightweight, and type-safe structured logger for real-time infrastructure.

Voltlog-io is a structured logger designed for high-throughput systems like IoT platforms, WebSocket servers, and microservices. It is the default logging engine for ocpp-ws-io but works as a standalone logger in any TypeScript/JavaScript project.

If you are using ocpp-ws-io, you can import it directly from the package:

import { createLogger } from "ocpp-ws-io/logger";

No need to install voltlog-io separately.

It resolves common pain points in event-driven architectures: context tracking, sensitive data redaction, high-volume sampling, and developer experience.

✨ Key Features

  • 🚀 Zero-Dependency Core: Lightweight and fast. Only uses cuid2 for ID generation.
  • 🔒 Secure by Design: Built-in redaction middleware for passwords, tokens, and headers.
  • 📊 High-Throughput Ready: Intelligent sampling to log 1% of debug logs while keeping 100% of errors.
  • ⚡ Developer Experience: Beautiful, icon-rich pretty printing for local development.
  • 🔌 Universal Compatibility: Works in Node.js, Bun, Deno, and Browsers.
  • 🤖 AI Powered: Built-in middleware to enrich error logs with AI analysis.
  • 🧩 Pluggable Architecture: 10+ Middlewares and 12+ Transports included out of the box.

📦 Architecture

Voltlog uses a pipeline architecture:

  1. Logger: The entry point (logger.info(...)). Generates the log entry.
  2. Context: Attaches bound context (e.g., sessionId) and dynamic context (e.g., performance.now()).
  3. Middleware: A chain of functions that process, filter, or enrich the log entry.
  4. Transports: The final destinations (Console, File, Redis, Datadog...) where the log is sent.

🛠 Included Modules

Voltlog is strictly typed and works out of the box.

Transports (Destinations)

TransportDescriptionEnvironment
ConsoleStandard JSON output to stdout/stderr.Universal
PrettyColorful, human-readable output for development.Universal
FileWrites logs to rotating files on disk.Server
JSON StreamWrites NDJSON to any WritableStream.Server
Browser StreamWrites NDJSON to WHATWG Streams.Browser
BatchBuffers logs for performance.Universal
RedisPublishes logs to Redis Streams.Server
DatadogSends logs to Datadog Intake API.Universal
LokiPushes logs to Grafana Loki.Universal
SlackSends notifications to Slack Webhooks.Universal
DiscordSends notifications to Discord Webhooks.Universal
SentryCaptures errors and breadcrumbs in Sentry.Universal
WebhookPOSTs logs to any HTTP endpoint.Universal

Middlewares (Processors)

MiddlewareDescription
RedactionMasks sensitive fields (password, token).
SamplingProbabilistic logging to reduce volume.
AlertTriggers callbacks/alerts based on conditions.
AI EnrichmentUses LLMs to explain errors in real-time.
OCPPSpecialized formatting for OCPP messages.
Correlation IDTracks requests across services.
DeduplicationGroups identical logs in a time window.
Heap UsageAdds memory stats (RSS/Heap) to logs.
IP ExtractionExtracts client IP from headers.
User AgentParses browser/OS info from UA string.
Level OverrideForce log level dynamically via headers.

🚀 Getting Started

Ready to log? Check out the Quick Start guide.

On this page