Interface FileHandlerOptions

Options for FileHandler.

interface FileHandlerOptions {
    bufferSize?: number;
    filename: string;
    formatter?: FormatterFunction;
    mode?: LogMode;
}
Hierarchy

Properties

bufferSize?: number

Buffer size for writing log messages to file, in bytes.

{4096}
filename: string

The filename to output to.

formatter?: FormatterFunction

A function that formats log records.

mode?: LogMode

Log mode for the handler. Behavior of the log modes is as follows:

  • 'a' - Default mode. Appends new log messages to the end of an existing log file, or create a new log file if none exists.
  • 'w' - Upon creation of the handler, any existing log file will be removed and a new one created.
  • 'x' - This will create a new log file and throw an error if one already exists.
{"a"}