Skip to main content
Version: Next

externalLoggerOptions

Index

Properties

externaloptionaldata

data?: Record<string, unknown>

Additional data to be added to each log line.

externaloptionalgradualLimitFactor

gradualLimitFactor?: number

Factor by which the limits (maxStringLength, maxArrayLength, maxFields) will be adjusted at each depth level.

Examples

  • If the factor is 0.5, the limits will be halved at each depth level.
  • If the factor is 1, the limits will be kept the same at each depth level.
  • If the factor is 2, the limits will be doubled at each depth level.

externaloptionallevel

level?: number

Sets the log level to the given value, preventing messages from less important log levels from being printed to the console. Use in conjunction with the log.LEVELS constants.

externaloptionallogger

logger?: Logger

Logger implementation to be used. Default one is log.LoggerText to log messages as easily readable strings. Optionally you can use log.LoggerJson that formats each log line as a JSON.

externaloptionalmaxArrayLength

maxArrayLength?: number

Max number of array items to be logged. More items will be omitted.

externaloptionalmaxDepth

maxDepth?: number

Max depth of data object that will be logged. Anything deeper than the limit will be stripped off.

externaloptionalmaxFields

maxFields?: number

Max number of fields to be logged. More fields will be omitted.

externaloptionalmaxStringLength

maxStringLength?: number

Max length of the string to be logged. Longer strings will be truncated.

externaloptionalpreferredFields

preferredFields?: PropertyKey[]

Ordered list of fields that should be prioritized when logging objects.

externaloptionalprefix

prefix?: null | string

Prefix to be prepended the each logged line.

externaloptionalsuffix

suffix?: null | string

Suffix that will be appended the each logged line.

externaloptionaltruncationFlagKey

truncationFlagKey?: string

Key of the flag property that will be added to the object if it is truncated.

externaloptionaltruncationSuffix

truncationSuffix?: string

Suffix that will be appended to truncated strings, objects and arrays.