Documentation / zerotal / logger / LoggingConfig
Function: LoggingConfig()
LoggingConfig(
options?):LoggingConfigShape
Defined in: packages/core/src/logger/config.ts:78
Build a LoggingConfigShape with framework defaults applied.
Out of the box every entry goes two places: the terminal, and a date-rotated
file under ./storage/logs kept for 14 days. Both are on by default and
independent of each other — you can silence the terminal without losing the
trail, which is the entire point of having one.
Named channels are extra destinations layered on top, for routing a
subsystem somewhere specific. Because channels is a name-keyed map,
anything you add is merged in rather than replacing the map.
Parameters
options?
Partial<LoggingConfigShape> = {}
Partial overrides deep-merged over the defaults.
Returns
The resolved, fully-populated logging config.
Examples
// config/logging.ts — the defaults, spelled out
import { LoggingConfig } from "@zerotal/core/logger";
export default LoggingConfig();
// Quiet terminal, full trail on disk, a month of history
export default LoggingConfig({
console: { level: "warn" },
file: { days: 30 },
});
// No files at all — containers that ship stdout to a collector
export default LoggingConfig({ file: false });