Configure log levels and file options for an AppLogger.

const infoLogger = loggerApp({
level: 'info' // console and file will log any levels `info` and above
});

const logger = loggerApp({
console: 'debug', // console will log `debug` and higher
file: 'warn' // file will log `warn` and higher
});

const fileLogger = loggerRollingApp({
console: 'debug', // console will log `debug` and higher
file: {
level: 'warn', // file will log `warn` and higher
path: '/my/cool/path/output.log', // optionally, output to log file at this path
frequency: 'hourly', // optionally, rotate hourly
}
});
interface LogOptions {
    level?:
        | "silent"
        | "fatal"
        | "error"
        | "warn"
        | "info"
        | "log"
        | "verbose"
        | "debug";
    file?:
        | false
        | "silent"
        | "fatal"
        | "error"
        | "warn"
        | "info"
        | "log"
        | "verbose"
        | "debug"
        | FileLogOptions;
    console?:
        | "silent"
        | "fatal"
        | "error"
        | "warn"
        | "info"
        | "log"
        | "verbose"
        | "debug";
}

Properties

Properties

level?:
    | "silent"
    | "fatal"
    | "error"
    | "warn"
    | "info"
    | "log"
    | "verbose"
    | "debug"

Specify the minimum log level for all log outputs without their own level specified.

Defaults to env LOG_LEVEL or info if not specified.

'info'
file?:
    | false
    | "silent"
    | "fatal"
    | "error"
    | "warn"
    | "info"
    | "log"
    | "verbose"
    | "debug"
    | FileLogOptions

Specify the minimum log level to output to rotating files or file output options. If false no log files will be created.

console?:
    | "silent"
    | "fatal"
    | "error"
    | "warn"
    | "info"
    | "log"
    | "verbose"
    | "debug"

Specify the minimum log level streamed to the console (or docker container)