# Interface PlatformLoggerSettings

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

# Overview

interface PlatformLoggerSettings {
debug?<span class="token punctuation">:</span> <span class="token keyword">boolean</span><span class="token punctuation">;</span>

level?<span class="token punctuation">:</span> <span class="token string">"debug"</span> | "info" | "warn" | "error" | "off"<span class="token punctuation">;</span>

requestFields?<span class="token punctuation">:</span> <span class="token punctuation">(</span>"reqId" | "method" | "url" | "headers" | "body" | "query" | "params" | "duration" | <span class="token keyword">string</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>

ignoreUrlPatterns?<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>

logRequest?<span class="token punctuation">:</span> <span class="token keyword">boolean</span><span class="token punctuation">;</span>

logStart?<span class="token punctuation">:</span> <span class="token keyword">boolean</span><span class="token punctuation">;</span>

logEnd?<span class="token punctuation">:</span> <span class="token keyword">boolean</span><span class="token punctuation">;</span>

jsonIndentation?<span class="token punctuation">:</span> <span class="token keyword">number</span><span class="token punctuation">;</span>

reqIdBuilder?<span class="token punctuation">:</span> <span class="token punctuation">(</span>req<span class="token punctuation">:</span> TsED.<a href="/api/common/mvc/decorators/params/Request.html"><span class="token">Request</span></a><span class="token punctuation">)</span> =&gt; <span class="token keyword">string</span><span class="token punctuation">;</span>

disableRoutesSummary?<span class="token punctuation">:</span> <span class="token keyword">boolean</span><span class="token punctuation">;</span>

disableBootstrapLog?<span class="token punctuation">:</span> <span class="token keyword">boolean</span><span class="token punctuation">;</span>

format?<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">;</span>

maxStackSize?<span class="token punctuation">:</span> <span class="token keyword">number</span><span class="token punctuation">;</span>

}

# 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" | string)[];

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?: (req: TsED.Request) => 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.


disableBootstrapLog?: boolean;

Disable bootstrap log 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 @tsed/logger configuration.


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.

Other topics