Skip to main content
zerotal

Documentation


Documentation / zerotal / logger / Log

Variable: Log

const Log: LogManager

Defined in: packages/core/src/logger/Log.ts:35

Static facade over the container-bound LogManager.

Every access resolves the live log singleton, so Log exposes the full LogManager surface: the five level methods (debug/info/ warn/error/ fatal) on the default channel, plus channel and withContext. Available after the application has booted (the facade throws if accessed at module scope before boot).

Example

import { Log } from "@zerotal/core/logger";

// Level + structured context.
Log.info("Order placed", { orderId: 99, total: 42.5 });

// Attach an error — its message and stack are captured onto the entry.
Log.error("Charge failed", { orderId: 99 }, err);

// Contextual logging: shared fields merged into every subsequent entry.
const scoped = Log.withContext({ tenant: "acme" });
scoped.warn("Quota nearly exhausted", { pct: 92 });

// Target a specific configured channel.
Log.channel("daily").info("Persisted to today's rotating file");