DILoggerOptions
Usage
import { DILoggerOptions } from "@tsed/di";
See /packages/di/src/types/common/interfaces/DILoggerOptions.ts.
Overview
interface DILoggerOptions {
debug?: boolean;
level?: "debug" | "info" | "warn" | "error" | "off";
perf?: boolean;
ignoreUrlPatterns?: (string | RegExp)[];
jsonIndentation?: number;
reqIdBuilder?: (req: any) => string;
disableRoutesSummary?: boolean;
disableBootstrapLog?: boolean;
format?: string;
maxStackSize?: number;
}
debug
debug?: boolean;
Enable debug mode. By default debug is false.
level
level?: "debug" | "info" | "warn" | "error" | "off";
Enable info mode. By default debug is false.
perf
perf?: boolean;
Enable log performance tracker and disable log server.
ignoreUrlPatterns:
ignoreUrlPatterns?: (string | RegExp)[];
List of regexp to ignore log.
jsonIndentation
jsonIndentation?: number;
The number of space characters to use as white space in JSON output. Default is 2 (0 in production).
reqIdBuilder:
reqIdBuilder?: (req: any) => string;
A function called for each incoming request to create a request id.
disableRoutesSummary
disableRoutesSummary?: boolean;
Disable routes table displayed in the logger. By default debug is false
.
disableBootstrapLog
disableBootstrapLog?: boolean;
Disable bootstrap log displayed in the logger. By default debug is false
.
format
format?: string;
Specify log format. Example: %[%d{[yyyy-MM-dd hh:mm:ss,SSS}] %p%] %m
. See @tsed/logger configuration.
maxStackSize
maxStackSize?: number;
Specify the log stack size for the context.logger. When the stack.length is reach, the logger is flushed during the request. Default size is set to 30.