Module: utils/logger

Logging helper

we use the winston library to simplify logging see: https://github.com/winstonjs/winston for API docs

Source:

Members

(inner, constant) PIIAttributes

List of Personally Identifiable Information (PII) that we want to filter from the logs.

Source:

(inner) isLoggerSetupComplete

Flag for whether logger setup has completed (following config module init)

Source:

Methods

(inner) log(message, options) → {winston.log|null}

Log a message to console in accordance with the SDK configuration

NOTE: If an Error object is passed as the message, it will log both the error's message and stack trace.

Parameters:
Name Type Description
message string

Log message

options object

Options object

Properties
Name Type Description
level string

Log level

meta object

Optional log metadata

data object

Optional log data to be sanitized and replace log placeholders

Source:
Returns:

Returns a log message, along with optional metadata (if the module:config option verbose is true).

Type
winston.log | null

(inner) mergeMessageAndData(message, data) → {string}

Takes a message string and a data object, returning a string with redacted and filtered data.

Parameters:
Name Type Description
message string

The string template with placeholders.

data object

Object containing unfiltered data to be included in the log message.

Source:
Returns:

log string with filtered values.

Type
string

(inner) setLogFilePath(path)

Sets the path for the log file and enable file logging.

NOTE: Runs on module initialization.

Parameters:
Name Type Description
path string

Log file path

Source: