Class SimpleJsonDestination

A minimalistic json based destination that will output json in the following sequence:

  • t: time of the log in the ISO format
  • m: message that start with first char of severity + | + log message
  • e: error message if Error object passed
  • s: error stack trace (unless logStackTrace set to false)
  • other payload sent to the logger

Hierarchy

Constructors

Properties

_logInterceptor: undefined | ((entry: IJLogEntry, loggerLevel?: LogLevel, defaultPayload?: IJson) => void) = undefined
_logNameFilter: undefined | string[]
level?: LogLevel

Accessors

  • get filters(): undefined | string[]
  • Returns undefined | string[]

Methods

  • This method must be called by the subclass to write the log entry. It cannot be automated as the basic design of the log destination is to allow the subclass' .write method to return different type of value depending on the implementation.

    Parameters

    Returns void

  • Add this destination to LoggerFactory. Usage:

    Use default or configured setting from logger.json

    • SimpleJsonDestination.use());

    Set both level and logger name filter

    • SimpleJsonDestination.use(LogLevel.INFO, 'my-logger');

    Set only logger name filter

    • SimpleJsonDestination.use('my-logger', 'another-logger');

    Returns

    Parameters

    • Optional level: string | LogLevel
    • Rest ...filters: string[]

    Returns SimpleJsonDestination

Generated using TypeDoc