function LoggerPlugin
Since 0.1.0
LoggerPlugin(options?: LoggerPluginOptions): IPlugin

Creates the LoggerPlugin.

The plugin depends on the runtime plugin (CAPABILITIES.RUNTIME) and registers its ILogger under CAPABILITIES.LOGGER at PLUGIN_PRIORITY.HIGH so logging is available before most other plugins register.

Examples

Example 1

import { LoggerPlugin } from '@setu-ts/logger-plugin';

app.register(LoggerPlugin({
  level: 'debug',
  transport: 'console',
  pretty: true,
  redact: ['password', 'token'],
  requestLogging: true,
  slowRequestThreshold: 1000,
}));

Parameters

optional
options: LoggerPluginOptions

Plugin configuration

Return Type

IPlugin

The plugin instance

Usage

import { LoggerPlugin } from "logger-plugin/src/index.ts";