Skip to main content
zerotal

Documentation


Documentation / @zerotal/core / logger / SingleChannel

Class: SingleChannel

Defined in: logger/channels/SingleChannel.ts:20

Appends every entry as a JSON line to a single, fixed log file.

Parent directories are created on demand. Write failures are swallowed so a logging error never propagates into application code.

Example

// config/logging.ts
channels: {
  single: { driver: "single", path: "./storage/logs/app.log", level: "info" },
}

Implements

Constructors

Constructor

new SingleChannel(_file): SingleChannel

Defined in: logger/channels/SingleChannel.ts:22

Parameters

_file

string

Path to the log file to append to (config key path).

Returns

SingleChannel

Methods

write()

write(entry): Promise<void>

Defined in: logger/channels/SingleChannel.ts:24

Parameters

entry

LogEntry

Returns

Promise<void>

Implementation of

LogChannel.write