इस प्रोजेक्ट के बारे में
The `@oresoftware/next-loggers` package provides a canonical, dependency-free, ESM-only structured logging solution designed for modern JavaScript and TypeScript environments, including Next.js, browsers, Cloudflare Workers, Node.js, Bun, and Deno. It emphasizes safety, serialization, and flexible transport mechanisms.
**Core Features:**
- **Polyglot Support:** Includes native SDKs for Python, Go, Rust, Java, Dart, Ruby, Erlang, and Elixir, all emitting a strict `next-loggers/v1` wire format.
- **Transports:** Supports HTTP endpoints, Supabase Realtime WebSockets, and OpenTelemetry (OTLP) sidecars for Kubernetes and Cloud Run. Custom transports are easily implemented via a simple interface.
- **Chainable API:** Log events are chainable, allowing enrichment with traces, tags, fields, and context before sending. An ESLint plugin enforces explicit `.send()` calls to prevent missed logs.
- **Security & Redaction:** Automatically redacts sensitive keys (passwords, tokens, etc.) and normalizes complex data structures (circular refs, errors, bigints) for safe serialization.
- **Runtime Specifics:** Offers specialized entry points for different runtimes (e.g., `createCloudflareWorkerLogger` adds `rayId` and geo properties). It handles async context isolation via `AsyncLocalStorage` where supported, with clear fallbacks for environments like Cloudflare Workers without specific flags.
- **Shutdown & Reliability:** Implements coordinated lifecycle drains for browsers (`pagehide`, `sendBeacon`) and Node/Bun/Deno (`SIGTERM`, `beforeExit`) to ensure logs are flushed before process termination. Includes serialization limits to prevent oversized payloads from crashing processes.
- **CLI & Config:** Ships with a `next-loggers` CLI for diagnostics (`doctor`, `resolve`, `smoke`) and supports configuration via `.next-logger.ts` files or environment variables.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.