Overview & Quick Start
Configure-once structured logging
@nexload-sdk/logger
v5.0.1 ReleasedConfigure-once structured logger for Node, Edge and browser, built on pino, with safe defaults.
Examples follow workspace source. Check pending Changesets against your installed version.
The logger implementation records structured events at service boundaries. Configure one logger per runtime, then use the shared logger or a module child throughout your application.
10-Second Code Snippet
Section titled “10-Second Code Snippet”import { configureLogger, logger } from "@nexload-sdk/logger";
configureLogger({ service: "shop-api" });
const log = logger.child({ module: "orders" });log.success({ event: "order.lifecycle.placed", orderId: "123" }, "Order placed");Installation & Peer Dependencies
Section titled “Installation & Peer Dependencies”pnpm add @nexload-sdk/loggernpm install @nexload-sdk/loggeryarn add @nexload-sdk/loggerbun add @nexload-sdk/loggerCompatibility Requirements
Section titled “Compatibility Requirements”| Runtime / Dependency | Support | Notes |
|---|---|---|
| Node.js and Bun | Server logger | JSON lines to stdout in production, readable output by default in development |
| Edge and browser | Same root API | Pass request identifiers explicitly |
| pino | Bundled as a package dependency | No peer dependencies to install |
When to Use Logger
Section titled “When to Use Logger”Use it for request summaries, outbound provider calls, job runs, process lifecycle events, and business milestones. Use the Healthcheck packages for probes and metrics. Use your platform’s log collector for shipping stdout logs and a dedicated telemetry integration for distributed spans.
Quick Start: Configure a Service
Section titled “Quick Start: Configure a Service”Call configureLogger in your service entry point before accepting requests. Module children created before startup configuration follow the configured logger on subsequent calls.
import { configureLogger } from "@nexload-sdk/logger";
configureLogger({ service: "shop-api", release: process.env.RELEASE });Next Steps
Section titled “Next Steps”- Explore Production Guides & Recipes for Next.js startup, trace propagation, redaction, and migration.
- Check the API Reference & Compatibility for the root and testing exports.