diff --git a/functions/factory.buildDestinationFile.html b/functions/factory.buildDestinationFile.html index 2839cfb..8d1d42d 100644 --- a/functions/factory.buildDestinationFile.html +++ b/functions/factory.buildDestinationFile.html @@ -1,2 +1,2 @@ buildDestinationFile | @foxxmd/logging Docs

Generated using TypeDoc

\ No newline at end of file +

Parameters

Returns LogLevelStreamEntry

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/factory.buildDestinationJsonPrettyStream.html b/functions/factory.buildDestinationJsonPrettyStream.html index 669230c..b9b29a8 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
  • Parameters

    Returns LogLevelStreamEntry

    See

    DestinationStream

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/functions/factory.buildDestinationRollingFile.html b/functions/factory.buildDestinationRollingFile.html index 4a81108..db03363 100644 --- a/functions/factory.buildDestinationRollingFile.html +++ b/functions/factory.buildDestinationRollingFile.html @@ -1,2 +1,2 @@ buildDestinationRollingFile | @foxxmd/logging Docs

    Function buildDestinationRollingFile

    Generated using TypeDoc

    \ No newline at end of file +

    Parameters

    Returns Promise<LogLevelStreamEntry>

    Generated using TypeDoc

    \ No newline at end of file diff --git a/functions/factory.buildDestinationStderr.html b/functions/factory.buildDestinationStderr.html index eee3b64..5cf13d2 100644 --- a/functions/factory.buildDestinationStderr.html +++ b/functions/factory.buildDestinationStderr.html @@ -2,4 +2,4 @@

    Parameters

    Returns LogLevelStreamEntry

    Source

    const buildDestinationStderr = (level: LogLevel, options: Omit<StreamDestination, 'destination'> = {}): LogLevelStreamEntry => {
    const opts = {...prettyColorizeEnv, ...options, destination: destination({dest: 2, sync: true})};
    return buildDestinationStream(level, opts);
    }

    See

    buildDestinationStream

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/functions/factory.buildDestinationStdout.html b/functions/factory.buildDestinationStdout.html index 1025833..f63d718 100644 --- a/functions/factory.buildDestinationStdout.html +++ b/functions/factory.buildDestinationStdout.html @@ -2,4 +2,4 @@

    Parameters

    Returns LogLevelStreamEntry

    Source

    const buildDestinationStdout = (level: LogLevel, options: Omit<StreamDestination, 'destination'> = {}): LogLevelStreamEntry => {
    const opts = {...prettyColorizeEnv, ...options, destination: destination({dest: 1, sync: true})}
    return buildDestinationStream(level, opts);
    }

    See

    buildDestinationStream

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/functions/factory.buildDestinationStream.html b/functions/factory.buildDestinationStream.html index 3a4983c..a57d32e 100644 --- a/functions/factory.buildDestinationStream.html +++ b/functions/factory.buildDestinationStream.html @@ -1,3 +1,3 @@ buildDestinationStream | @foxxmd/logging Docs

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/functions/factory.buildLogger.html b/functions/factory.buildLogger.html index 4a19200..159b3f0 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.

      Parameters

      Returns Logger

      See

      Logger

      -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/functions/factory.prettyOptsConsoleFactory.html b/functions/factory.prettyOptsConsoleFactory.html index 6a2c8fa..63ab307 100644 --- a/functions/factory.prettyOptsConsoleFactory.html +++ b/functions/factory.prettyOptsConsoleFactory.html @@ -1,4 +1,4 @@ prettyOptsConsoleFactory | @foxxmd/logging Docs
    • Generate pino-pretty PrettyOptions for use with console/stream output

      Parameters

      Returns PrettyOptions_

      Source

      const prettyOptsConsoleFactory = (opts: PrettyOptionsExtra = {}): PrettyOptions => prettyOptsFactory({...opts, ...PRETTY_OPTS_CONSOLE_DEFAULTS})
       
      -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/functions/factory.prettyOptsFactory.html b/functions/factory.prettyOptsFactory.html index 155cd8e..c1a9a77 100644 --- a/functions/factory.prettyOptsFactory.html +++ b/functions/factory.prettyOptsFactory.html @@ -1,2 +1,2 @@ prettyOptsFactory | @foxxmd/logging Docs

    Generated using TypeDoc

    \ No newline at end of file +

    Parameters

    Returns PrettyOptions_

    Generated using TypeDoc

    \ No newline at end of file diff --git a/functions/factory.prettyOptsFileFactory.html b/functions/factory.prettyOptsFileFactory.html index f35a7d0..c93e524 100644 --- a/functions/factory.prettyOptsFileFactory.html +++ b/functions/factory.prettyOptsFileFactory.html @@ -1,4 +1,4 @@ prettyOptsFileFactory | @foxxmd/logging Docs
    • Generate pino-pretty PrettyOptions for use with file output

      Parameters

      Returns PrettyOptions_

      Source

      const prettyOptsFileFactory = (opts: PrettyOptionsExtra = {}): PrettyOptions => prettyOptsFactory({...opts, ...PRETTY_OPTS_FILE_DEFAULTS})
       
      -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/functions/index.childLogger.html b/functions/index.childLogger.html index 78359f1..346f91c 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

    Generated using TypeDoc

    \ No newline at end of file +

    Returns Logger

    Generated using TypeDoc

    \ No newline at end of file diff --git a/functions/index.isLogOptions.html b/functions/index.isLogOptions.html index fe0cf10..c2718e4 100644 --- a/functions/index.isLogOptions.html +++ b/functions/index.isLogOptions.html @@ -1 +1 @@ -isLogOptions | @foxxmd/logging Docs

    Generated using TypeDoc

    \ No newline at end of file +isLogOptions | @foxxmd/logging Docs

    Generated using TypeDoc

    \ No newline at end of file diff --git a/functions/index.loggerApp.html b/functions/index.loggerApp.html index 18e2a55..82faacf 100644 --- a/functions/index.loggerApp.html +++ b/functions/index.loggerApp.html @@ -1,2 +1,2 @@ loggerApp | @foxxmd/logging Docs

    Generated using TypeDoc

    \ No newline at end of file +

    Parameters

    Returns Logger

    Generated using TypeDoc

    \ No newline at end of file diff --git a/functions/index.loggerAppRolling.html b/functions/index.loggerAppRolling.html index 7c55a60..de58dc7 100644 --- a/functions/index.loggerAppRolling.html +++ b/functions/index.loggerAppRolling.html @@ -1,2 +1,2 @@ loggerAppRolling | @foxxmd/logging Docs

    Generated using TypeDoc

    \ No newline at end of file +

    Parameters

    Returns Promise<Logger>

    Generated using TypeDoc

    \ No newline at end of file diff --git a/functions/index.parseLogOptions.html b/functions/index.parseLogOptions.html index d92b5e2..10b049b 100644 --- a/functions/index.parseLogOptions.html +++ b/functions/index.parseLogOptions.html @@ -1,2 +1,2 @@ parseLogOptions | @foxxmd/logging Docs

    Generated using TypeDoc

    \ No newline at end of file +

    Parameters

    Returns LogOptionsParsed

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/index.FileLogOptions.html b/interfaces/index.FileLogOptions.html index 77afdc5..38b598c 100644 --- a/interfaces/index.FileLogOptions.html +++ b/interfaces/index.FileLogOptions.html @@ -1,7 +1,7 @@ FileLogOptions | @foxxmd/logging Docs

    Specify and override default log file options

    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? @@ -11,12 +11,12 @@

    Numerical values will be considered as MB.

    Default

    '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.

    Default

    '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
    • @@ -34,12 +34,12 @@

    Default

    '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

    Type declaration

      • (): string
      • Returns string

    Default

    './logs/app.log'
     

    See

    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.

    -

    Generated using TypeDoc

    \ No newline at end of file +
    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.

    +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/index.LogOptions.html b/interfaces/index.LogOptions.html index bfb4bf0..aada2b5 100644 --- a/interfaces/index.LogOptions.html +++ b/interfaces/index.LogOptions.html @@ -1,13 +1,13 @@ LogOptions | @foxxmd/logging Docs

    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

    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.

    Default

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

    -

    Generated using TypeDoc

    \ No newline at end of file +
    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)

    +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/index.LoggerAppExtras.html b/interfaces/index.LoggerAppExtras.html index 0243c8d..64e53a8 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

    See

    FileOptions

    Default

    '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

    See

    FileOptions

    Default

    './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

    -

    Generated using TypeDoc

    \ No newline at end of file +
    pretty?: PrettyOptionsExtra

    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

    +
    pino?: PinoLoggerOptions

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

    +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/index.PrettyOptionsExtra.html b/interfaces/index.PrettyOptionsExtra.html index c7c0fcc..23e39dc 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;
        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;
        redactCwd?: boolean;
        padLevels?: boolean;
    }

    Hierarchy (view full)

    Properties

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

    NOTE: Only applies to log message and errors. If you need to redact arbitrary properties you should use pino's redact or pino-pretty's customPrettifiers

    Default

    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

    Default

    true
     
    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/index._internal_.FileLogOptionsStrong.html b/interfaces/index._internal_.FileLogOptionsStrong.html index 0281e9a..d60e6b3 100644 --- a/interfaces/index._internal_.FileLogOptionsStrong.html +++ b/interfaces/index._internal_.FileLogOptionsStrong.html @@ -1,7 +1,7 @@ FileLogOptionsStrong | @foxxmd/logging Docs

    Specify and override default log file options

    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 @@ -11,12 +11,12 @@

    Numerical values will be considered as MB.

    Default

    '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.

    Default

    '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
    • @@ -34,12 +34,12 @@

    Default

    '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

    Type declaration

      • (): string
      • Returns string

    Default

    './logs/app.log'
     

    See

    LoggerAppExtras

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/index._internal_.FileLogPathOptions.html b/interfaces/index._internal_.FileLogPathOptions.html index e83bcb6..99ef225 100644 --- a/interfaces/index._internal_.FileLogPathOptions.html +++ b/interfaces/index._internal_.FileLogPathOptions.html @@ -1,12 +1,12 @@ -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.

    See

    FileOptions

    Default

    '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

    See

    FileOptions

    Default

    './logs/app.log'
     
    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/index._internal_.FileOptions.html b/interfaces/index._internal_.FileOptions.html index 0aeb0d1..fc9933b 100644 --- a/interfaces/index._internal_.FileOptions.html +++ b/interfaces/index._internal_.FileOptions.html @@ -1,7 +1,7 @@ FileOptions | @foxxmd/logging Docs

    Specify and override default log file options

    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? @@ -10,12 +10,12 @@

    Numerical values will be considered as MB.

    Default

    '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.

    Default

    '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
    • @@ -33,11 +33,11 @@

    Default

    '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

    Type declaration

      • (): string
      • Returns string

    Default

    './logs/app.log'
     

    See

    LoggerAppExtras

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/index._internal_.PinoRollOptions.html b/interfaces/index._internal_.PinoRollOptions.html index d9108b5..dc5c481 100644 --- a/interfaces/index._internal_.PinoRollOptions.html +++ b/interfaces/index._internal_.PinoRollOptions.html @@ -1,13 +1,13 @@ -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.

    Numerical values will be considered as MB.

    Default

    '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.

    Default

    'daily'
     
    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/index._internal_.RollOptions.html b/interfaces/index._internal_.RollOptions.html index 8a705c2..85afba6 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

      @@ -17,4 +17,4 @@

    Default

    'auto'
     
    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/modules/factory.html b/modules/factory.html index 656b330..ac19af2 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 47ee596..0d1dd3e 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 c595451..fee8981 100644 --- a/types/factory.FileDestination.html +++ b/types/factory.FileDestination.html @@ -1 +1 @@ -FileDestination | @foxxmd/logging Docs
    FileDestination: Omit<PrettyOptionsExtra, "destination" | "sync"> & FileOptionsParsed

    Generated using TypeDoc

    \ No newline at end of file +FileDestination | @foxxmd/logging Docs
    FileDestination: Omit<PrettyOptionsExtra, "destination" | "sync"> & FileOptionsParsed

    Generated using TypeDoc

    \ No newline at end of file diff --git a/types/factory.JsonPrettyDestination.html b/types/factory.JsonPrettyDestination.html index dfc4b09..01a63ec 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

    • Optional object?: boolean

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

      -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/types/factory.StreamDestination.html b/types/factory.StreamDestination.html index 80766b3..eb9f9a2 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;
    }

    Type declaration

    Generated using TypeDoc

    \ No newline at end of file +StreamDestination | @foxxmd/logging Docs
    StreamDestination: Omit<PrettyOptionsExtra, "destination"> & {
        destination: number | DestinationStream | WritableStream;
    }

    Type declaration

    Generated using TypeDoc

    \ No newline at end of file diff --git a/types/factory._internal_.FileOptionsParsed.html b/types/factory._internal_.FileOptionsParsed.html index 760c4d7..94df217 100644 --- a/types/factory._internal_.FileOptionsParsed.html +++ b/types/factory._internal_.FileOptionsParsed.html @@ -1 +1 @@ -FileOptionsParsed | @foxxmd/logging Docs
    FileOptionsParsed: MarkRequired<FileOptions, "path">

    Generated using TypeDoc

    \ No newline at end of file +FileOptionsParsed | @foxxmd/logging Docs
    FileOptionsParsed: MarkRequired<FileOptions, "path">

    Generated using TypeDoc

    \ No newline at end of file diff --git a/types/factory._internal_.PinoLoggerOptions.html b/types/factory._internal_.PinoLoggerOptions.html index d10acad..f52146d 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

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/types/index.LogData.html b/types/index.LogData.html index 84af1d1..05e2a22 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

    -

    Type declaration

    • level: number
    • time: number
    • pid: number
    • hostname: string
    • labels: any[]
    • msg: string | Error

    Generated using TypeDoc

    \ No newline at end of file +

    Type declaration

    • level: number
    • time: number
    • pid: number
    • hostname: string
    • labels: any[]
    • msg: string | Error

    Generated using TypeDoc

    \ No newline at end of file diff --git a/types/index.LogDataPretty.html b/types/index.LogDataPretty.html index 889d7f0..bed4836 100644 --- a/types/index.LogDataPretty.html +++ b/types/index.LogDataPretty.html @@ -1 +1 @@ -LogDataPretty | @foxxmd/logging Docs
    LogDataPretty: LogData & {
        line: string;
    }

    Type declaration

    • line: string

    Generated using TypeDoc

    \ No newline at end of file +LogDataPretty | @foxxmd/logging Docs
    LogDataPretty: LogData & {
        line: string;
    }

    Type declaration

    • line: string

    Generated using TypeDoc

    \ No newline at end of file diff --git a/types/index.LogLevel.html b/types/index.LogLevel.html index ff8431b..141e0bd 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.

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/types/index.LogLevelStreamEntry.html b/types/index.LogLevelStreamEntry.html index be0ceb3..f2cfb2f 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

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/types/index.Logger.html b/types/index.Logger.html index 99fded2..8658b42 100644 --- a/types/index.Logger.html +++ b/types/index.Logger.html @@ -1 +1 @@ -Logger | @foxxmd/logging Docs
    Logger: Logger<LogLevel> & {
        labels: any[];
        addLabel: ((value) => void);
    }

    Type declaration

    • labels: any[]
    • addLabel: ((value) => void)
        • (value): void
        • Parameters

          • value: any

          Returns void

    Generated using TypeDoc

    \ No newline at end of file +Logger | @foxxmd/logging Docs
    Logger: Logger<LogLevel> & {
        labels: any[];
        addLabel: ((value) => void);
    }

    Type declaration

    • labels: any[]
    • addLabel: ((value) => void)
        • (value): void
        • Parameters

          • value: any

          Returns void

    Generated using TypeDoc

    \ No newline at end of file diff --git a/types/index._internal_.FileLogOptionsParsed.html b/types/index._internal_.FileLogOptionsParsed.html index 885a53b..8e06ed9 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

    Generated using TypeDoc

    \ No newline at end of file +FileLogOptionsParsed | @foxxmd/logging Docs
    FileLogOptionsParsed: Omit<FileLogOptions, "file"> & {
        level: false;
    } | FileLogOptionsStrong

    Generated using TypeDoc

    \ No newline at end of file diff --git a/types/index._internal_.LogOptionsParsed.html b/types/index._internal_.LogOptionsParsed.html index 9c06048..2b78dc9 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;
    }

    Type declaration

    Generated using TypeDoc

    \ No newline at end of file +LogOptionsParsed | @foxxmd/logging Docs
    LogOptionsParsed: Omit<Required<LogOptions>, "file"> & {
        file: FileLogOptionsParsed;
    }

    Type declaration

    Generated using TypeDoc

    \ No newline at end of file diff --git a/variables/factory.PRETTY_COLORS.html b/variables/factory.PRETTY_COLORS.html index c13b41e..5bec02f 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

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/variables/factory.PRETTY_COLORS_STR.html b/variables/factory.PRETTY_COLORS_STR.html index 0071cc8..914f62e 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

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/variables/factory.PRETTY_ISO8601.html b/variables/factory.PRETTY_ISO8601.html index da5bccd..fe472bf 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

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/variables/factory.PRETTY_OPTS_CONSOLE.html b/variables/factory.PRETTY_OPTS_CONSOLE.html index f077194..90c7b21 100644 --- a/variables/factory.PRETTY_OPTS_CONSOLE.html +++ b/variables/factory.PRETTY_OPTS_CONSOLE.html @@ -1,4 +1,4 @@ PRETTY_OPTS_CONSOLE | @foxxmd/logging Docs

    Variable PRETTY_OPTS_CONSOLEConst

    PRETTY_OPTS_CONSOLE: PrettyOptions_ = ...

    Pre-defined pino-pretty PrettyOptions for use with console/stream output

    Source

    const PRETTY_OPTS_CONSOLE: PrettyOptions = prettyOptsConsoleFactory()
     
    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/variables/factory.PRETTY_OPTS_FILE.html b/variables/factory.PRETTY_OPTS_FILE.html index 7f9d366..26a533b 100644 --- a/variables/factory.PRETTY_OPTS_FILE.html +++ b/variables/factory.PRETTY_OPTS_FILE.html @@ -1,4 +1,4 @@ PRETTY_OPTS_FILE | @foxxmd/logging Docs

    Variable PRETTY_OPTS_FILEConst

    PRETTY_OPTS_FILE: PrettyOptions_ = ...

    Pre-defined pino-pretty PrettyOptions for use with file output

    Source

    const PRETTY_OPTS_FILE: PrettyOptions = prettyOptsFileFactory()
     
    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/variables/index.LOG_LEVEL_NAMES.html b/variables/index.LOG_LEVEL_NAMES.html index dca73f1..3425430 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"] = ...

    Generated using TypeDoc

    \ No newline at end of file +LOG_LEVEL_NAMES | @foxxmd/logging Docs

    Variable LOG_LEVEL_NAMESConst

    LOG_LEVEL_NAMES: readonly ["silent", "fatal", "error", "warn", "info", "log", "verbose", "debug"] = ...

    Generated using TypeDoc

    \ No newline at end of file diff --git a/variables/index.loggerDebug.html b/variables/index.loggerDebug.html index caeca52..24a1436 100644 --- a/variables/index.loggerDebug.html +++ b/variables/index.loggerDebug.html @@ -1,4 +1,4 @@ loggerDebug | @foxxmd/logging Docs

    Variable loggerDebugConst

    loggerDebug: Logger = ...

    A logger that ONLY logs to console at minimum 'debug' level. Useful for logging during startup before a loggerApp has been initialized

    Source

    const loggerDebug = buildLogger('debug', [buildDestinationStdout('debug')])
     
    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/variables/index.loggerTest.html b/variables/index.loggerTest.html index 5f06f3a..912c9ce 100644 --- a/variables/index.loggerTest.html +++ b/variables/index.loggerTest.html @@ -1,4 +1,4 @@ loggerTest | @foxxmd/logging Docs

    Variable loggerTestConst

    loggerTest: Logger = ...

    A noop (no output) logger for use when testing a component that requires a Logger

    Source

    const loggerTest = buildLogger('silent', [buildDestinationStdout('debug')])
     
    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file