# RequestLogger Class

Module
import { RequestLogger } from "@tsed/common"
Source/packages/common/src/platform/domain/RequestLogger.ts

# Overview

class RequestLogger {
<span class="token keyword">readonly</span> id<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">;</span>
<span class="token keyword">readonly</span> url<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">;</span>
<span class="token keyword">readonly</span> startDate<span class="token punctuation">:</span> <span class="token keyword">Date</span><span class="token punctuation">;</span>
maxStackSize<span class="token punctuation">:</span> <span class="token keyword">number</span><span class="token punctuation">;</span>
minimalRequestPicker<span class="token punctuation">:</span> Function<span class="token punctuation">;</span>
completeRequestPicker<span class="token punctuation">:</span> Function<span class="token punctuation">;</span>



<span class="token keyword">constructor</span><span class="token punctuation">(</span>logger<span class="token punctuation">:</span> <span class="token keyword">any</span><span class="token punctuation">,</span> <span class="token punctuation">{</span> id<span class="token punctuation">,</span> startDate<span class="token punctuation">,</span> url<span class="token punctuation">,</span> ignoreUrlPatterns<span class="token punctuation">,</span> minimalRequestPicker<span class="token punctuation">,</span> completeRequestPicker<span class="token punctuation">,</span> level<span class="token punctuation">,</span> maxStackSize <span class="token punctuation">}</span><span class="token punctuation">:</span> <span class="token keyword">any</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token function">info</span><span class="token punctuation">(</span>obj<span class="token punctuation">:</span> <span class="token keyword">any</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">void</span><span class="token punctuation">;</span>
<span class="token function">debug</span><span class="token punctuation">(</span>obj<span class="token punctuation">:</span> <span class="token keyword">any</span><span class="token punctuation">,</span> withRequest?<span class="token punctuation">:</span> <span class="token keyword">boolean</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">void</span><span class="token punctuation">;</span>
<span class="token function">warn</span><span class="token punctuation">(</span>obj<span class="token punctuation">:</span> <span class="token keyword">any</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">void</span><span class="token punctuation">;</span>
<span class="token function">error</span><span class="token punctuation">(</span>obj<span class="token punctuation">:</span> <span class="token keyword">any</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">void</span><span class="token punctuation">;</span>
<span class="token function">trace</span><span class="token punctuation">(</span>obj<span class="token punctuation">:</span> <span class="token keyword">any</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">void</span><span class="token punctuation">;</span>
<span class="token function">flush</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">void</span><span class="token punctuation">;</span>
<span class="token function">isLevelEnabled</span><span class="token punctuation">(</span>otherLevel<span class="token punctuation">:</span> <span class="token keyword">string</span> | LogLevel<span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">boolean</span><span class="token punctuation">;</span>
<span class="token function">destroy</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">void</span><span class="token punctuation">;</span>
/**
 * Return the duration between the time when LogIncomingRequest has handle the request and now.
 * @returns <span class="token punctuation">{</span><span class="token keyword">number</span><span class="token punctuation">}</span>
 */
<span class="token keyword">protected</span> <span class="token function">getDuration</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">number</span><span class="token punctuation">;</span>
<span class="token keyword">protected</span> <span class="token function">getData</span><span class="token punctuation">(</span>obj<span class="token punctuation">:</span> <span class="token keyword">any</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">any</span><span class="token punctuation">;</span>
<span class="token keyword">protected</span> <span class="token function">run</span><span class="token punctuation">(</span>level<span class="token punctuation">:</span> LogLevel<span class="token punctuation">,</span> cb<span class="token punctuation">:</span> Function<span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">void</span><span class="token punctuation">;</span>

}