@eryx/logging/FileHandler Module

JSON

File log handler.

Writes log records to a file opened in append mode. Output can be human-readable text or JSON lines (asJson = true).

Summary

Functions

FileHandler.new(path: string, options: Options?)Handler

API Reference

Functions

FileHandler.new

Creates a file-backed logging handler.

The returned handler writes one line per log record to path.

FileHandler.new(path: string, options: Options?)Handler

Parameters

path: string

Destination file path.

options: Options?

Optional handler behavior (json mode, flush policy, filter, ...).

Returns

A logging handler with an optional close() method.

Types

LogRecord

type LogRecord = LoggingTypes.LogRecord
Implements: LoggingTypes.LogRecord

LevelInput

type LevelInput = LoggingTypes.LevelInput
Implements: LoggingTypes.LevelInput

Handler

type Handler = LoggingTypes.Handler
Implements: LoggingTypes.Handler

Options

type Options = { level: LevelInput?, filter: (((record: LogRecord) → boolean))?, flushEachWrite: boolean?, asJson: boolean?, includeSource: boolean? }
level: LevelInput?
filter: (((record: LogRecord) → boolean))?
flushEachWrite: boolean?
asJson: boolean?
includeSource: boolean?