diff --git a/functions/factory.buildDestinationFile.html b/functions/factory.buildDestinationFile.html index 9e9e7d7..2a60a6e 100644 --- a/functions/factory.buildDestinationFile.html +++ b/functions/factory.buildDestinationFile.html @@ -1,2 +1,2 @@ buildDestinationFile | @foxxmd/logging Docs

Creates a LogLevelStreamEntry stream that writes to a static file at or above the minimum level

-
+
diff --git a/functions/factory.buildDestinationJsonPrettyStream.html b/functions/factory.buildDestinationJsonPrettyStream.html index 55263da..26f699a 100644 --- a/functions/factory.buildDestinationJsonPrettyStream.html +++ b/functions/factory.buildDestinationJsonPrettyStream.html @@ -7,4 +7,4 @@
  • the destination stream passed MUST be set to objectMode: true
  • DestinationStream

    -
    +
    diff --git a/functions/factory.buildDestinationRollingFile.html b/functions/factory.buildDestinationRollingFile.html index 3441a4a..65e5f3e 100644 --- a/functions/factory.buildDestinationRollingFile.html +++ b/functions/factory.buildDestinationRollingFile.html @@ -1,2 +1,2 @@ buildDestinationRollingFile | @foxxmd/logging Docs

    Function buildDestinationRollingFile

    Creates a LogLevelStreamEntry stream that writes to a rolling file at or above the minimum level

    -
    +
    diff --git a/functions/factory.buildDestinationStderr.html b/functions/factory.buildDestinationStderr.html index 4d6c2cd..0a67b66 100644 --- a/functions/factory.buildDestinationStderr.html +++ b/functions/factory.buildDestinationStderr.html @@ -3,4 +3,4 @@

    buildDestinationStream

    -
    +
    diff --git a/functions/factory.buildDestinationStdout.html b/functions/factory.buildDestinationStdout.html index 7728872..ecdcd36 100644 --- a/functions/factory.buildDestinationStdout.html +++ b/functions/factory.buildDestinationStdout.html @@ -3,4 +3,4 @@

    buildDestinationStream

    -
    +
    diff --git a/functions/factory.buildDestinationStream.html b/functions/factory.buildDestinationStream.html index 225f707..d062be8 100644 --- a/functions/factory.buildDestinationStream.html +++ b/functions/factory.buildDestinationStream.html @@ -1,3 +1,3 @@ buildDestinationStream | @foxxmd/logging Docs

    Creates a LogLevelStreamEntry stream that writes to a NodeJs.WriteableStream or Sonic Boom DestinationStream at or above the minimum level

    DestinationStream

    -
    +
    diff --git a/functions/factory.buildLogger.html b/functions/factory.buildLogger.html index 338e396..cb3b62f 100644 --- a/functions/factory.buildLogger.html +++ b/functions/factory.buildLogger.html @@ -1,4 +1,4 @@ buildLogger | @foxxmd/logging Docs

    Builds a Logger object for use in your application

    defaultLevel must the minimum level ANY stream can log from IE it should be the lowest level any of your streams will possibly log. Recommended to always use debug.

    Logger

    -
    +
    diff --git a/functions/factory.prettyOptsConsoleFactory.html b/functions/factory.prettyOptsConsoleFactory.html index 715b6ac..1cf4f26 100644 --- a/functions/factory.prettyOptsConsoleFactory.html +++ b/functions/factory.prettyOptsConsoleFactory.html @@ -2,4 +2,4 @@
    const prettyOptsConsoleFactory = (opts: PrettyOptionsExtra = {}): PrettyOptions => prettyOptsFactory({...opts, ...PRETTY_OPTS_CONSOLE_DEFAULTS})
     
    -
    +
    diff --git a/functions/factory.prettyOptsFactory.html b/functions/factory.prettyOptsFactory.html index a936f97..0ef22a8 100644 --- a/functions/factory.prettyOptsFactory.html +++ b/functions/factory.prettyOptsFactory.html @@ -1,2 +1,2 @@ prettyOptsFactory | @foxxmd/logging Docs

    Builds the opinionated @foxxmd/logging defaults for pino-pretty PrettyOptions and merges them with an optional user-provided PrettyOptions object

    -
    +
    diff --git a/functions/factory.prettyOptsFileFactory.html b/functions/factory.prettyOptsFileFactory.html index 8939159..532bc47 100644 --- a/functions/factory.prettyOptsFileFactory.html +++ b/functions/factory.prettyOptsFileFactory.html @@ -2,4 +2,4 @@
    const prettyOptsFileFactory = (opts: PrettyOptionsExtra = {}): PrettyOptions => prettyOptsFactory({...opts, ...PRETTY_OPTS_FILE_DEFAULTS})
     
    -
    +
    diff --git a/functions/index.childLogger.html b/functions/index.childLogger.html index 4cf2f28..d8de637 100644 --- a/functions/index.childLogger.html +++ b/functions/index.childLogger.html @@ -3,4 +3,4 @@
  • labelsVal: any = []

    (any | any[]) Labels to always apply to logs from this logger

  • context: object = {}

    object Additional properties to always apply to logs from this logger

  • options: {} = {}

    object

    -
  • Returns Logger

    +

    Returns Logger

    diff --git a/functions/index.isLogOptions.html b/functions/index.isLogOptions.html index e1fff6c..0c3e70f 100644 --- a/functions/index.isLogOptions.html +++ b/functions/index.isLogOptions.html @@ -1 +1 @@ -isLogOptions | @foxxmd/logging Docs
    +isLogOptions | @foxxmd/logging Docs
    diff --git a/functions/index.loggerApp.html b/functions/index.loggerApp.html index 011d590..c3d961b 100644 --- a/functions/index.loggerApp.html +++ b/functions/index.loggerApp.html @@ -1,2 +1,2 @@ loggerApp | @foxxmd/logging Docs

    A Logger that logs to console and a static file

    -
    +
    diff --git a/functions/index.loggerAppRolling.html b/functions/index.loggerAppRolling.html index 6220605..106599a 100644 --- a/functions/index.loggerAppRolling.html +++ b/functions/index.loggerAppRolling.html @@ -1,2 +1,2 @@ loggerAppRolling | @foxxmd/logging Docs

    A Logger that logs to console and a rolling file

    -
    +
    diff --git a/functions/index.parseLogOptions.html b/functions/index.parseLogOptions.html index 66c2919..bcf9a1a 100644 --- a/functions/index.parseLogOptions.html +++ b/functions/index.parseLogOptions.html @@ -1,2 +1,2 @@ parseLogOptions | @foxxmd/logging Docs

    Takes an object and parses it into a fully-populated LogOptions object based on opinionated defaults

    -
    +
    diff --git a/index.html b/index.html index 58df105..23e4676 100644 --- a/index.html +++ b/index.html @@ -62,14 +62,15 @@

    Thus you could set COLORED_STD=true in your Dockerfile to coerce colored output to docker logs. If a user does not want colored output for any reason they can simply override the environmental variable like COLORED_STD=false

    Pino Child loggers can be created using the childLogger function with the added ability to inherit Labels from their parent loggers.

    Labels are inserted between the log level and message contents of a log. The child logger inherits all labels from all its parent loggers.

    -

    childLogger accepts a single string label or an array of string labels.

    -
    import {loggerApp, childLogger} from '@foxxmd/logging';

    logger = loggerApp();
    logger.debug('Test');
    // [2024-03-07 11:27:41.944 -0500] DEBUG: Test

    const nestedChild1 = childLogger(logger, 'First');
    nestedChild1.debug('I am nested one level');
    // [2024-03-07 11:27:41.945 -0500] DEBUG: [First] I am nested one level

    const nestedChild2 = childLogger(nestedChild1, ['Second', 'Third']);
    nestedChild2.warn('I am nested two levels but with more labels');
    // [2024-03-07 11:27:41.945 -0500] WARN: [First] [Second] [Third] I am nested two levels but with more labels

    const siblingLogger = childLogger(logger, ['1Sib','2Sib']);
    siblingLogger.info('Test');
    // [2024-03-07 11:27:41.945 -0500] INFO: [1Sib] [2Sib] Test +

    childLogger accepts a single string/function label or an array of string/function labels.

    +
    import {loggerApp, childLogger} from '@foxxmd/logging';

    logger = loggerApp();
    logger.debug('Test');
    // [2024-03-07 11:27:41.944 -0500] DEBUG: Test

    const nestedChild1 = childLogger(logger, 'First');
    nestedChild1.debug('I am nested one level');
    // [2024-03-07 11:27:41.945 -0500] DEBUG: [First] I am nested one level

    const nestedChild2 = childLogger(nestedChild1, ['Second', () => 'Third']);
    nestedChild2.warn('I am nested two levels but with more labels');
    // [2024-03-07 11:27:41.945 -0500] WARN: [First] [Second] [Third] I am nested two levels but with more labels

    const siblingLogger = childLogger(logger, ['1Sib','2Sib']);
    siblingLogger.info('Test');
    // [2024-03-07 11:27:41.945 -0500] INFO: [1Sib] [2Sib] Test

    Labels can also be added at "runtime" by passing an object with labels prop to the logger level function. These labels will be appended to any existing labels on the logger.

    logger.debug({labels: ['MyLabel']}, 'My log message');
     
    +

    NOTE: If a label function throws an error then the label will be the error's message. Make sure your labels don't throw!

    Passing an object or array as the first argument to the logger will cause the object to be JSONified and pretty printed below the log message

    logger.debug({myProp: 'a string', nested: {anotherProps: ['val1', 'val2'], boolProp: true}}, 'Test');
    /*
    [2024-03-07 11:39:37.687 -0500] DEBUG: Test
    myProp: "a string"
    nested: {
    "anotherProps": [
    "val1",
    "val2"
    ],
    "boolProp": true
    }
    */
    diff --git a/interfaces/index.FileLogOptions.html b/interfaces/index.FileLogOptions.html index 6578a4e..99ecd5b 100644 --- a/interfaces/index.FileLogOptions.html +++ b/interfaces/index.FileLogOptions.html @@ -2,7 +2,7 @@
    const fileLogger = loggerRollingApp({
    file: {
    level: 'warn', // file will log `warn` and higher
    path: '/my/cool/path/output.log', // output to log file at this path
    frequency: 'daily', // rotate hourly
    size: '20MB', // rotate if file size grows larger than 20MB
    timestamp: 'unix' // use unix epoch timestamp instead of iso8601 in rolling file
    }
    });
    -
    interface FileLogOptions {
        size?: string | number;
        frequency?: number | "daily" | "hourly";
        timestamp?: "unix" | "iso" | "auto";
        path?: string | (() => string);
        level?:
            | false
            | "silent"
            | "fatal"
            | "error"
            | "warn"
            | "info"
            | "log"
            | "verbose"
            | "debug";
    }

    Hierarchy (view full)

    Properties

    interface FileLogOptions {
        size?: string | number;
        frequency?: number | "daily" | "hourly";
        timestamp?: "unix" | "iso" | "auto";
        path?: string | (() => string);
        level?:
            | false
            | "silent"
            | "fatal"
            | "error"
            | "warn"
            | "info"
            | "log"
            | "verbose"
            | "debug";
    }

    Hierarchy (view full)

    Properties

    size? frequency? timestamp? path? @@ -13,13 +13,13 @@
    '10MB'
     
    -
    frequency?: number | "daily" | "hourly"

    The amount of time a given rolling log file is used. Can be combined with size.

    +
    frequency?: number | "daily" | "hourly"

    The amount of time a given rolling log file is used. Can be combined with size.

    Use daily or hourly to rotate file every day (or every hour). Existing file within the current day (or hour) will be re-used.

    Numerical values will be considered as a number of milliseconds. Using a numerical value will always create a new file upon startup.

    'daily'
     
    -
    timestamp?: "unix" | "iso" | "auto"

    For rolling log files

    +
    timestamp?: "unix" | "iso" | "auto"

    For rolling log files

    When

    • value passed to rolling destination is a string (path from LogOptions is a string) and
    • @@ -39,7 +39,7 @@
    'auto'
     
    -
    path?: string | (() => string)

    The path and filename to use for log files.

    +
    path?: string | (() => string)

    The path and filename to use for log files.

    If using rolling files the filename will be appended with .N (a number) BEFORE the extension based on rolling status.

    May also be specified using env LOG_PATH or a function that returns a string.

    If path is relative the absolute path will be derived from logBaseDir (in LoggerAppExtras) which defaults to CWD

    @@ -47,5 +47,5 @@

    LoggerAppExtras

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

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

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

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

    +
    diff --git a/interfaces/index.LogOptions.html b/interfaces/index.LogOptions.html index 1841d91..451db34 100644 --- a/interfaces/index.LogOptions.html +++ b/interfaces/index.LogOptions.html @@ -2,7 +2,7 @@
    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

    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.

    @@ -10,6 +10,6 @@
    '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)

    -
    +
    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)

    +
    diff --git a/interfaces/index.LoggerAppExtras.html b/interfaces/index.LoggerAppExtras.html index da18845..cc9d2f7 100644 --- a/interfaces/index.LoggerAppExtras.html +++ b/interfaces/index.LoggerAppExtras.html @@ -1,5 +1,5 @@ LoggerAppExtras | @foxxmd/logging Docs

    Additional settings and Pino Transports to apply to the returned Logger.

    -
    interface LoggerAppExtras {
        logBaseDir?: string;
        logDefaultPath?: string;
        pretty?: PrettyOptionsExtra;
        destinations?: LogLevelStreamEntry[];
        pino?: PinoLoggerOptions;
    }

    Hierarchy (view full)

    Properties

    interface LoggerAppExtras {
        logBaseDir?: string;
        logDefaultPath?: string;
        pretty?: PrettyOptionsExtra;
        destinations?: LogLevelStreamEntry[];
        pino?: PinoLoggerOptions;
    }

    Hierarchy (view full)

    Properties

    logBaseDir? logDefaultPath? pretty? destinations? @@ -9,13 +9,13 @@
    'CWD'
     
    -
    logDefaultPath?: string

    The default path to use when parsing file logging options.

    +
    logDefaultPath?: string

    The default path to use when parsing file logging options.

    If this path is relative it is joined with logBaseDir

    FileOptions

    './logs/app.log'
     
    -

    Additional pino-pretty options that are applied to the built-in console/log streams

    -
    destinations?: LogLevelStreamEntry[]

    Additional logging destinations to use alongside the built-in console/log stream. These can be any created by buildDestination* functions or other Pino Transports

    -

    Additional Pino Log options that are passed to pino() on logger creation

    -
    +

    Additional pino-pretty options that are applied to the built-in console/log streams

    +
    destinations?: LogLevelStreamEntry[]

    Additional logging destinations to use alongside the built-in console/log stream. These can be any created by buildDestination* functions or other Pino Transports

    +

    Additional Pino Log options that are passed to pino() on logger creation

    +
    diff --git a/interfaces/index.PrettyOptionsExtra.html b/interfaces/index.PrettyOptionsExtra.html index 1b82614..94d4891 100644 --- a/interfaces/index.PrettyOptionsExtra.html +++ b/interfaces/index.PrettyOptionsExtra.html @@ -1,5 +1,5 @@ PrettyOptionsExtra | @foxxmd/logging Docs

    pino-pretty options and additional options specific to how @foxxmd/logging uses pino-pretty

    -
    interface PrettyOptionsExtra {
        hideObject?: boolean;
        translateTime?: string | boolean;
        levelFirst?: boolean;
        levelKey?: string;
        levelLabel?: string;
        messageKey?: string;
        singleLine?: boolean;
        timestampKey?: string;
        minimumLevel?: Level;
        messageFormat?: string | false | MessageFormatFunc;
        colorize?: boolean;
        colorizeObjects?: boolean;
        crlf?: boolean;
        errorLikeObjectKeys?: string[];
        errorProps?: string;
        ignore?: string;
        include?: string;
        sync?: boolean;
        destination?:
            | string
            | number
            | DestinationStream
            | WritableStream;
        append?: boolean;
        mkdir?: boolean;
        customPrettifiers?: Record<string, Prettifier<object>> & {
            level?: Prettifier<LevelPrettifierExtras>;
        };
        customColors?: string | object;
        useOnlyCustomProps?: boolean;
        redactCwd?: boolean;
        padLevels?: boolean;
    }

    Hierarchy (view full)

    Properties

    interface PrettyOptionsExtra {
        hideObject?: boolean;
        translateTime?: string | boolean;
        levelFirst?: boolean;
        levelKey?: string;
        levelLabel?: string;
        messageKey?: string;
        singleLine?: boolean;
        timestampKey?: string;
        minimumLevel?: Level;
        messageFormat?: string | false | MessageFormatFunc;
        colorize?: boolean;
        colorizeObjects?: boolean;
        crlf?: boolean;
        errorLikeObjectKeys?: string[];
        errorProps?: string;
        ignore?: string;
        include?: string;
        sync?: boolean;
        destination?:
            | string
            | number
            | DestinationStream
            | WritableStream;
        append?: boolean;
        mkdir?: boolean;
        customPrettifiers?: Record<string, Prettifier<object>> & {
            level?: Prettifier<LevelPrettifierExtras>;
        };
        customColors?: string | object;
        useOnlyCustomProps?: boolean;
        redactCwd?: boolean;
        padLevels?: boolean;
    }

    Hierarchy (view full)

    Properties

    hideObject? translateTime? levelFirst? levelKey? @@ -150,8 +150,8 @@ Also supports 'default' as level_name for fallback color.

    true
     
    -
    padLevels?: boolean

    Pads levels in log string so all are the same length

    +
    padLevels?: boolean

    Pads levels in log string so all are the same length

    true
     
    -
    +
    diff --git a/interfaces/index._internal_.FileLogOptionsStrong.html b/interfaces/index._internal_.FileLogOptionsStrong.html index 7e72eaa..6ef26ce 100644 --- a/interfaces/index._internal_.FileLogOptionsStrong.html +++ b/interfaces/index._internal_.FileLogOptionsStrong.html @@ -2,7 +2,7 @@
    const fileLogger = loggerRollingApp({
    file: {
    level: 'warn', // file will log `warn` and higher
    path: '/my/cool/path/output.log', // output to log file at this path
    frequency: 'daily', // rotate hourly
    size: '20MB', // rotate if file size grows larger than 20MB
    timestamp: 'unix' // use unix epoch timestamp instead of iso8601 in rolling file
    }
    });
    -
    interface FileLogOptionsStrong {
        size?: string | number;
        frequency?: number | "daily" | "hourly";
        timestamp?: "unix" | "iso" | "auto";
        level:
            | "silent"
            | "fatal"
            | "error"
            | "warn"
            | "info"
            | "log"
            | "verbose"
            | "debug";
        path: string | (() => string);
    }

    Hierarchy (view full)

    Properties

    interface FileLogOptionsStrong {
        size?: string | number;
        frequency?: number | "daily" | "hourly";
        timestamp?: "unix" | "iso" | "auto";
        level:
            | "silent"
            | "fatal"
            | "error"
            | "warn"
            | "info"
            | "log"
            | "verbose"
            | "debug";
        path: string | (() => string);
    }

    Hierarchy (view full)

    Properties

    size? frequency? timestamp? level @@ -13,13 +13,13 @@
    '10MB'
     
    -
    frequency?: number | "daily" | "hourly"

    The amount of time a given rolling log file is used. Can be combined with size.

    +
    frequency?: number | "daily" | "hourly"

    The amount of time a given rolling log file is used. Can be combined with size.

    Use daily or hourly to rotate file every day (or every hour). Existing file within the current day (or hour) will be re-used.

    Numerical values will be considered as a number of milliseconds. Using a numerical value will always create a new file upon startup.

    'daily'
     
    -
    timestamp?: "unix" | "iso" | "auto"

    For rolling log files

    +
    timestamp?: "unix" | "iso" | "auto"

    For rolling log files

    When

    • value passed to rolling destination is a string (path from LogOptions is a string) and
    • @@ -39,8 +39,8 @@
    'auto'
     
    -
    level:
        | "silent"
        | "fatal"
        | "error"
        | "warn"
        | "info"
        | "log"
        | "verbose"
        | "debug"

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

    -
    path: string | (() => string)

    The path and filename to use for log files.

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

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

    +
    path: string | (() => string)

    The path and filename to use for log files.

    If using rolling files the filename will be appended with .N (a number) BEFORE the extension based on rolling status.

    May also be specified using env LOG_PATH or a function that returns a string.

    If path is relative the absolute path will be derived from logBaseDir (in LoggerAppExtras) which defaults to CWD

    @@ -48,4 +48,4 @@

    LoggerAppExtras

    -
    +
    diff --git a/interfaces/index._internal_.FileLogPathOptions.html b/interfaces/index._internal_.FileLogPathOptions.html index 2bb6ac3..fb38d42 100644 --- a/interfaces/index._internal_.FileLogPathOptions.html +++ b/interfaces/index._internal_.FileLogPathOptions.html @@ -1,14 +1,14 @@ -FileLogPathOptions | @foxxmd/logging Docs
    interface FileLogPathOptions {
        logBaseDir?: string;
        logDefaultPath?: string;
    }

    Hierarchy (view full)

    Properties

    logBaseDir? +FileLogPathOptions | @foxxmd/logging Docs
    interface FileLogPathOptions {
        logBaseDir?: string;
        logDefaultPath?: string;
    }

    Hierarchy (view full)

    Properties

    logBaseDir?: string

    The base path to use when parsing file logging options.

    FileOptions

    'CWD'
     
    -
    logDefaultPath?: string

    The default path to use when parsing file logging options.

    +
    logDefaultPath?: string

    The default path to use when parsing file logging options.

    If this path is relative it is joined with logBaseDir

    FileOptions

    './logs/app.log'
     
    -
    +
    diff --git a/interfaces/index._internal_.FileOptions.html b/interfaces/index._internal_.FileOptions.html index fc1ce20..cabed1d 100644 --- a/interfaces/index._internal_.FileOptions.html +++ b/interfaces/index._internal_.FileOptions.html @@ -2,7 +2,7 @@
    const fileLogger = loggerRollingApp({
    file: {
    level: 'warn', // file will log `warn` and higher
    path: '/my/cool/path/output.log', // output to log file at this path
    frequency: 'daily', // rotate hourly
    size: '20MB', // rotate if file size grows larger than 20MB
    timestamp: 'unix' // use unix epoch timestamp instead of iso8601 in rolling file
    }
    });
    -
    interface FileOptions {
        size?: string | number;
        frequency?: number | "daily" | "hourly";
        timestamp?: "unix" | "iso" | "auto";
        path?: string | (() => string);
    }

    Hierarchy (view full)

    Properties

    interface FileOptions {
        size?: string | number;
        frequency?: number | "daily" | "hourly";
        timestamp?: "unix" | "iso" | "auto";
        path?: string | (() => string);
    }

    Hierarchy (view full)

    Properties

    size? frequency? timestamp? path? @@ -12,13 +12,13 @@
    '10MB'
     
    -
    frequency?: number | "daily" | "hourly"

    The amount of time a given rolling log file is used. Can be combined with size.

    +
    frequency?: number | "daily" | "hourly"

    The amount of time a given rolling log file is used. Can be combined with size.

    Use daily or hourly to rotate file every day (or every hour). Existing file within the current day (or hour) will be re-used.

    Numerical values will be considered as a number of milliseconds. Using a numerical value will always create a new file upon startup.

    'daily'
     
    -
    timestamp?: "unix" | "iso" | "auto"

    For rolling log files

    +
    timestamp?: "unix" | "iso" | "auto"

    For rolling log files

    When

    • value passed to rolling destination is a string (path from LogOptions is a string) and
    • @@ -38,7 +38,7 @@
    'auto'
     
    -
    path?: string | (() => string)

    The path and filename to use for log files.

    +
    path?: string | (() => string)

    The path and filename to use for log files.

    If using rolling files the filename will be appended with .N (a number) BEFORE the extension based on rolling status.

    May also be specified using env LOG_PATH or a function that returns a string.

    If path is relative the absolute path will be derived from logBaseDir (in LoggerAppExtras) which defaults to CWD

    @@ -46,4 +46,4 @@

    LoggerAppExtras

    -
    +
    diff --git a/interfaces/index._internal_.PinoRollOptions.html b/interfaces/index._internal_.PinoRollOptions.html index de66996..82e125a 100644 --- a/interfaces/index._internal_.PinoRollOptions.html +++ b/interfaces/index._internal_.PinoRollOptions.html @@ -1,4 +1,4 @@ -PinoRollOptions | @foxxmd/logging Docs
    interface PinoRollOptions {
        size?: string | number;
        frequency?: number | "daily" | "hourly";
    }

    Hierarchy (view full)

    Properties

    size? +PinoRollOptions | @foxxmd/logging Docs
    interface PinoRollOptions {
        size?: string | number;
        frequency?: number | "daily" | "hourly";
    }

    Hierarchy (view full)

    Properties

    Properties

    size?: string | number

    The maximum size of a given rolling log file.

    Can be combined with frequency. Use k, m and g to express values in KB, MB or GB.

    @@ -6,10 +6,10 @@
    '10MB'
     
    -
    frequency?: number | "daily" | "hourly"

    The amount of time a given rolling log file is used. Can be combined with size.

    +
    frequency?: number | "daily" | "hourly"

    The amount of time a given rolling log file is used. Can be combined with size.

    Use daily or hourly to rotate file every day (or every hour). Existing file within the current day (or hour) will be re-used.

    Numerical values will be considered as a number of milliseconds. Using a numerical value will always create a new file upon startup.

    'daily'
     
    -
    +
    diff --git a/interfaces/index._internal_.RollOptions.html b/interfaces/index._internal_.RollOptions.html index 252b125..8edd53e 100644 --- a/interfaces/index._internal_.RollOptions.html +++ b/interfaces/index._internal_.RollOptions.html @@ -1,4 +1,4 @@ -RollOptions | @foxxmd/logging Docs
    interface RollOptions {
        timestamp?: "unix" | "iso" | "auto";
    }

    Hierarchy (view full)

    Properties

    timestamp? +RollOptions | @foxxmd/logging Docs
    interface RollOptions {
        timestamp?: "unix" | "iso" | "auto";
    }

    Hierarchy (view full)

    Properties

    Properties

    timestamp?: "unix" | "iso" | "auto"

    For rolling log files

    When

      @@ -19,4 +19,4 @@
    'auto'
     
    -
    +
    diff --git a/modules/factory.html b/modules/factory.html index 6476600..a5fe003 100644 --- a/modules/factory.html +++ b/modules/factory.html @@ -1,4 +1,4 @@ -factory | @foxxmd/logging Docs

    Index

    Modules

    <internal> +factory | @foxxmd/logging Docs

    Index

    Modules

    Type Aliases

    FileDestination StreamDestination JsonPrettyDestination diff --git a/modules/index.html b/modules/index.html index 05426f4..1e325e7 100644 --- a/modules/index.html +++ b/modules/index.html @@ -1,4 +1,4 @@ -index | @foxxmd/logging Docs

    Index

    Modules

    <internal> +index | @foxxmd/logging Docs

    Index

    Modules

    Interfaces

    LogOptions FileLogOptions LoggerAppExtras diff --git a/types/factory.FileDestination.html b/types/factory.FileDestination.html index c618b0c..7ae4507 100644 --- a/types/factory.FileDestination.html +++ b/types/factory.FileDestination.html @@ -1 +1 @@ -FileDestination | @foxxmd/logging Docs
    FileDestination: Omit<PrettyOptionsExtra, "destination" | "sync"> & FileOptionsParsed
    +FileDestination | @foxxmd/logging Docs
    FileDestination: Omit<PrettyOptionsExtra, "destination" | "sync"> & FileOptionsParsed
    diff --git a/types/factory.JsonPrettyDestination.html b/types/factory.JsonPrettyDestination.html index 3efe9f8..aefa071 100644 --- a/types/factory.JsonPrettyDestination.html +++ b/types/factory.JsonPrettyDestination.html @@ -1,2 +1,2 @@ JsonPrettyDestination | @foxxmd/logging Docs

    Type Alias JsonPrettyDestination

    JsonPrettyDestination: StreamDestination & {
        object?: boolean;
    }

    Type declaration

    • Optionalobject?: boolean

      Specify if the stream should output log as object or stringified JSON

      -
    +
    diff --git a/types/factory.StreamDestination.html b/types/factory.StreamDestination.html index 680c526..2022253 100644 --- a/types/factory.StreamDestination.html +++ b/types/factory.StreamDestination.html @@ -1 +1 @@ -StreamDestination | @foxxmd/logging Docs
    StreamDestination: Omit<PrettyOptionsExtra, "destination"> & {
        destination: number | DestinationStream | WritableStream;
    }
    +StreamDestination | @foxxmd/logging Docs
    StreamDestination: Omit<PrettyOptionsExtra, "destination"> & {
        destination: number | DestinationStream | WritableStream;
    }
    diff --git a/types/factory._internal_.FileOptionsParsed.html b/types/factory._internal_.FileOptionsParsed.html index 5a26b6b..e0a661e 100644 --- a/types/factory._internal_.FileOptionsParsed.html +++ b/types/factory._internal_.FileOptionsParsed.html @@ -1 +1 @@ -FileOptionsParsed | @foxxmd/logging Docs
    FileOptionsParsed: MarkRequired<FileOptions, "path">
    +FileOptionsParsed | @foxxmd/logging Docs
    FileOptionsParsed: MarkRequired<FileOptions, "path">
    diff --git a/types/factory._internal_.PinoLoggerOptions.html b/types/factory._internal_.PinoLoggerOptions.html index 5826d2b..8cfc04e 100644 --- a/types/factory._internal_.PinoLoggerOptions.html +++ b/types/factory._internal_.PinoLoggerOptions.html @@ -1,2 +1,2 @@ PinoLoggerOptions | @foxxmd/logging Docs
    PinoLoggerOptions: Omit<LoggerOptions,
        | "level"
        | "mixin"
        | "mixinMergeStrategy"
        | "customLevels"
        | "useOnlyCustomLevels"
        | "transport">

    Additional Pino Log options that are passed to pino() on logger creation

    -
    +
    diff --git a/types/index.LogData.html b/types/index.LogData.html index e9064a3..5ff7dcd 100644 --- a/types/index.LogData.html +++ b/types/index.LogData.html @@ -1,2 +1,2 @@ LogData | @foxxmd/logging Docs
    LogData: Record<string, any> & {
        level: number;
        time: number;
        pid: number;
        hostname: string;
        labels: any[];
        msg: string | Error;
    }

    The structure of a Log object when returned by a stream data event

    -
    +
    diff --git a/types/index.LogDataPretty.html b/types/index.LogDataPretty.html index dbb8fbd..f14b8d7 100644 --- a/types/index.LogDataPretty.html +++ b/types/index.LogDataPretty.html @@ -1 +1 @@ -LogDataPretty | @foxxmd/logging Docs
    LogDataPretty: LogData & {
        line: string;
    }
    +LogDataPretty | @foxxmd/logging Docs
    LogDataPretty: LogData & {
        line: string;
    }
    diff --git a/types/index.LogLevel.html b/types/index.LogLevel.html index 3263c2e..79dc91f 100644 --- a/types/index.LogLevel.html +++ b/types/index.LogLevel.html @@ -11,4 +11,4 @@
  • silent (will never output anything)
  • When used in LogOptions specifies the minimum level the output should log at.

    -
    +
    diff --git a/types/index.LogLevelStreamEntry.html b/types/index.LogLevelStreamEntry.html index 99da710..4a8506a 100644 --- a/types/index.LogLevelStreamEntry.html +++ b/types/index.LogLevelStreamEntry.html @@ -1,3 +1,3 @@ LogLevelStreamEntry | @foxxmd/logging Docs

    Type Alias LogLevelStreamEntry

    LogLevelStreamEntry: StreamEntry<LogLevel>

    An object with a write function that can be used by pino as a Transport

    All buildDestination* functions return this type as well as any Pino Transport

    -
    +
    diff --git a/types/index.Logger.html b/types/index.Logger.html index 46799e8..c6f3bca 100644 --- a/types/index.Logger.html +++ b/types/index.Logger.html @@ -1 +1 @@ -Logger | @foxxmd/logging Docs
    Logger: Logger<LogLevel> & {
        labels: any[];
        addLabel: ((value: any) => void);
    }
    +Logger | @foxxmd/logging Docs
    Logger: Logger<LogLevel> & {
        labels: any[];
        addLabel: ((value: any) => void);
    }
    diff --git a/types/index._internal_.FileLogOptionsParsed.html b/types/index._internal_.FileLogOptionsParsed.html index fb4893b..6d63e3b 100644 --- a/types/index._internal_.FileLogOptionsParsed.html +++ b/types/index._internal_.FileLogOptionsParsed.html @@ -1 +1 @@ -FileLogOptionsParsed | @foxxmd/logging Docs
    FileLogOptionsParsed: Omit<FileLogOptions, "file"> & {
        level: false;
    } | FileLogOptionsStrong
    +FileLogOptionsParsed | @foxxmd/logging Docs
    FileLogOptionsParsed: Omit<FileLogOptions, "file"> & {
        level: false;
    } | FileLogOptionsStrong
    diff --git a/types/index._internal_.LogOptionsParsed.html b/types/index._internal_.LogOptionsParsed.html index d9c115f..4f1250a 100644 --- a/types/index._internal_.LogOptionsParsed.html +++ b/types/index._internal_.LogOptionsParsed.html @@ -1 +1 @@ -LogOptionsParsed | @foxxmd/logging Docs
    LogOptionsParsed: Omit<Required<LogOptions>, "file"> & {
        file: FileLogOptionsParsed;
    }
    +LogOptionsParsed | @foxxmd/logging Docs
    LogOptionsParsed: Omit<Required<LogOptions>, "file"> & {
        file: FileLogOptionsParsed;
    }
    diff --git a/variables/factory.PRETTY_COLORS.html b/variables/factory.PRETTY_COLORS.html index 1b6017a..2aeab94 100644 --- a/variables/factory.PRETTY_COLORS.html +++ b/variables/factory.PRETTY_COLORS.html @@ -1,3 +1,3 @@ PRETTY_COLORS | @foxxmd/logging Docs

    Variable PRETTY_COLORSConst

    PRETTY_COLORS: Extract<PrettyOptions["customColors"], object> = ...

    Additional level colors included in @foxxmd/logging as a string

    These are always applied when using prettyOptsFactory but can be overridden

    -
    +
    diff --git a/variables/factory.PRETTY_COLORS_STR.html b/variables/factory.PRETTY_COLORS_STR.html index bf40be8..7e6cf42 100644 --- a/variables/factory.PRETTY_COLORS_STR.html +++ b/variables/factory.PRETTY_COLORS_STR.html @@ -1,3 +1,3 @@ PRETTY_COLORS_STR | @foxxmd/logging Docs

    Variable PRETTY_COLORS_STRConst

    PRETTY_COLORS_STR: Extract<PrettyOptions["customColors"], string> = 'verbose:magenta,log:greenBright'

    Additional level colors included in @foxxmd/logging as an object

    These are always applied when using prettyOptsFactory but can be overridden

    -
    +
    diff --git a/variables/factory.PRETTY_ISO8601.html b/variables/factory.PRETTY_ISO8601.html index b6e0385..fc1d3b2 100644 --- a/variables/factory.PRETTY_ISO8601.html +++ b/variables/factory.PRETTY_ISO8601.html @@ -1,2 +1,2 @@ PRETTY_ISO8601 | @foxxmd/logging Docs

    Variable PRETTY_ISO8601Const

    PRETTY_ISO8601: "SYS:yyyy-mm-dd\"T\"HH:MM:ssp" = 'SYS:yyyy-mm-dd"T"HH:MM:ssp'

    Use on translateTime pino-pretty option to print timestamps in ISO8601 format

    -
    +
    diff --git a/variables/factory.PRETTY_OPTS_CONSOLE.html b/variables/factory.PRETTY_OPTS_CONSOLE.html index ac94e83..91c7e37 100644 --- a/variables/factory.PRETTY_OPTS_CONSOLE.html +++ b/variables/factory.PRETTY_OPTS_CONSOLE.html @@ -2,4 +2,4 @@
    const PRETTY_OPTS_CONSOLE: PrettyOptions = prettyOptsConsoleFactory()
     
    -
    +
    diff --git a/variables/factory.PRETTY_OPTS_FILE.html b/variables/factory.PRETTY_OPTS_FILE.html index 27d6ac3..c563087 100644 --- a/variables/factory.PRETTY_OPTS_FILE.html +++ b/variables/factory.PRETTY_OPTS_FILE.html @@ -2,4 +2,4 @@
    const PRETTY_OPTS_FILE: PrettyOptions = prettyOptsFileFactory()
     
    -
    +
    diff --git a/variables/index.LOG_LEVEL_NAMES.html b/variables/index.LOG_LEVEL_NAMES.html index f0c92ad..b3c4e70 100644 --- a/variables/index.LOG_LEVEL_NAMES.html +++ b/variables/index.LOG_LEVEL_NAMES.html @@ -1 +1 @@ -LOG_LEVEL_NAMES | @foxxmd/logging Docs

    Variable LOG_LEVEL_NAMESConst

    LOG_LEVEL_NAMES: readonly ["silent", "fatal", "error", "warn", "info", "log", "verbose", "debug"] = ...
    +LOG_LEVEL_NAMES | @foxxmd/logging Docs

    Variable LOG_LEVEL_NAMESConst

    LOG_LEVEL_NAMES: readonly ["silent", "fatal", "error", "warn", "info", "log", "verbose", "debug"] = ...
    diff --git a/variables/index.loggerDebug.html b/variables/index.loggerDebug.html index 1212c34..5724c4e 100644 --- a/variables/index.loggerDebug.html +++ b/variables/index.loggerDebug.html @@ -2,4 +2,4 @@
    const loggerDebug = buildLogger('debug', [buildDestinationStdout('debug')])
     
    -
    +
    diff --git a/variables/index.loggerTest.html b/variables/index.loggerTest.html index 35d4259..9b19acf 100644 --- a/variables/index.loggerTest.html +++ b/variables/index.loggerTest.html @@ -2,4 +2,4 @@
    const loggerTest = buildLogger('silent', [buildDestinationStdout('debug')])
     
    -
    +