Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ISettingsParam

Constructor: logger settings all values are optional and will be pre-filled with default values

Hierarchy

Index

Properties

Optional dateTimePattern

dateTimePattern: undefined | string

DateTime pattern based on Intl.DateTimeFormat.formatToParts with additional milliseconds, default: year-month-day hour:minute:second.millisecond

Optional dateTimeTimezone

dateTimeTimezone: undefined | string

DateTime timezone, e.g. utc, or Europe/Berlin, Europe/Moscow. You can use Intl.DateTimeFormat().resolvedOptions().timeZone for local timezone, default: "utc"

Optional displayDateTime

displayDateTime: undefined | false | true

Display date time at the beginning of a log message, default: true

Optional displayFilePath

displayFilePath: "hidden" | "displayAll" | "hideNodeModulesOnly"

Display file path, default "hideNodeModulesOnly"

Optional displayFunctionName

displayFunctionName: undefined | false | true

Display function name, default: true

Optional displayInstanceName

displayInstanceName: undefined | false | true

Display instanceName or not, default: false

Optional displayLogLevel

displayLogLevel: undefined | false | true

Display log level, default: true

Optional displayLoggerName

displayLoggerName: undefined | false | true

Display name of the logger. Will only be visible if name was set, default: true

Optional displayRequestId

displayRequestId: undefined | false | true

Display requestId or not, default: false

Optional displayTypes

displayTypes: undefined | false | true

Display type information for each attribute passed.

Optional exposeErrorCodeFrame

exposeErrorCodeFrame: undefined | false | true

Get Code Frame of an Error and expose it, default: true

Optional exposeErrorCodeFrameLinesBeforeAndAfter

exposeErrorCodeFrameLinesBeforeAndAfter: undefined | number

Capture lines before and after a code frame, default: 5

Optional exposeStack

exposeStack: undefined | false | true

Expose stack with EVERY log message, default: false

Optional instanceName

instanceName: undefined | string

Name of the instance name, default: host name

Optional jsonInspectOptions

jsonInspectOptions: InspectOptions

Options to be set for utils._inspectAndHideSensitive when output is set to json ({ type: "json" })

Optional logLevelsColors

logLevelsColors: TLogLevelColor

Overwrite colors of log messages of different log levels

Optional maskAny

maskAny: (string | number)[]

Mask all occurrences (case-sensitive) from logs (e.g. all secrets from ENVs etc.). Will be replaced with [***]

Optional maskPlaceholder

maskPlaceholder: undefined | string

String to use a placeholder to mask sensitive values.

Optional maskValuesOfKeys

maskValuesOfKeys: (string | number)[]

Exclude case-insensitive keys for object passed to tslog that could potentially contain sensitive information (e.g. password or Authorization), default: ["password"]

Optional minLevel

minLevel: TLogLevelName

Minimum output log level (e.g. debug), default: "silly"

Optional name

name: undefined | string

Optional name of the logger instance, default: undefined

Optional overwriteConsole

overwriteConsole: undefined | false | true

Catch logs going to console (e.g. console.log). Last instantiated Log instance wins

Optional prefix

prefix: unknown[]

Prefix every log message of this logger.

Optional prettyInspectHighlightStyles

prettyInspectHighlightStyles: IHighlightStyles

Overwrite colors json highlighting

Optional prettyInspectOptions

prettyInspectOptions: InspectOptions

Options to be set for utils._inspectAndHideSensitive when output is set to pretty, default: setting

Optional printLogMessageInNewLine

printLogMessageInNewLine: undefined | false | true

Print log message in a new line below meta information, default: false

Optional requestId

requestId: string | TRequestIdFunction

Optional request ID for grouping logs by a logical request. default: undefined

Optional setCallerAsLoggerName

setCallerAsLoggerName: undefined | false | true

Use the name of the caller type as the name of the logger, default: false

Optional stdErr

stdErr: IStd

Overwrite default std err

Optional stdOut

stdOut: IStd

Overwrite default std out

Optional suppressStdOutput

suppressStdOutput: undefined | false | true

Suppress any log output to std out / std err

Optional type

type: "json" | "pretty" | "hidden"

Print log pretty, as a stringified json or prevent printing with hidden, default: pretty

Generated using TypeDoc