Skip to content

platform/node/file-log-sink

Defined in: app/src/platform/node/file-log-sink.ts:22

Writes log records as JSON Lines to a local file and rotates it by size. Logs never leave the device. Write errors are swallowed, because logging must never break the browser.

new RotatingFileLogSink(options): RotatingFileLogSink

Defined in: app/src/platform/node/file-log-sink.ts:28

RotatingFileLogOptions

Location and rotation limits.

RotatingFileLogSink

write(record): void

Defined in: app/src/platform/node/file-log-sink.ts:33

Writes one record.

LogRecord

The record to write.

void

LogSink.write

Defined in: app/src/platform/node/file-log-sink.ts:6

Options for a RotatingFileLogSink.

readonly directory: string

Defined in: app/src/platform/node/file-log-sink.ts:8

Directory of the log files.

readonly optional keep?: number

Defined in: app/src/platform/node/file-log-sink.ts:14

Number of rotated files kept besides the current one. Defaults to 2.

readonly optional maxBytes?: number

Defined in: app/src/platform/node/file-log-sink.ts:12

Size at which the current file is rotated. Defaults to 5 MB.

readonly name: string

Defined in: app/src/platform/node/file-log-sink.ts:10

Base name; files are <name>.log, <name>.1.log, …