# ILoggerSettings Interface

Module
import { ILoggerSettings } from "@tsed/common"
Source/packages/common/src/config/interfaces/ILoggerSettings.ts

# Overview

interface ILoggerSettings {
    debug?: boolean;
    level?: "debug" | "info" | "warn" | "error" | "off";
    requestFields?: ("reqId" | "method" | "url" | "headers" | "body" | "query" | "params" | "duration")[];
    ignoreUrlPatterns?: string[];
    logRequest?: boolean;
    logStart?: boolean;
    logEnd?: boolean;
    jsonIndentation?: number;
    reqIdBuilder?: () => string;
    disableRoutesSummary?: boolean;
    format?: string;
}

# Members

debug?: boolean

Enable debug mode. By default debug is false.


level?: "debug" | "info" | "warn" | "error" | "off"

Enable info mode. By default debug is false.


requestFields?: ("reqId" | "method" | "url" | "headers" | "body" | "query" | "params" | "duration")[]

Fields displayed when a request is logged. Possible values: reqId, method, url, headers, body, query,params, duration.


ignoreUrlPatterns?: string[]

List of regexp to ignore log.


logRequest?: boolean

Log all incoming request. By default is true and print the configured logger.requestFields.


logStart?: boolean

Log start of all incoming request. By default is true


logEnd?: boolean

Log end of all incoming request. By default is true


jsonIndentation?: number

The number of space characters to use as white space in JSON output. Default is 2 (0 in production).


reqIdBuilder?: () => string

A function called for each incoming request to create a request id.


disableRoutesSummary?: boolean

Disable routes table displayed in the logger. By default debug is false.


format?: string

Specify log format. Example: %[%d{[yyyy-MM-dd hh:mm:ss,SSS}] %p%] %m. See ts-log-debug configuration.