# LoggerAppenders Class

Module
import { LoggerAppenders } from "@tsed/logger"
Source/packages/logger/src/logger/class/LoggerAppenders.ts

# Overview

class LoggerAppenders {
get <span class="token function">size</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>
/**
 * The `<span class="token function">has</span><span class="token punctuation">(</span><span class="token punctuation">)</span> method returns a <span class="token keyword">boolean</span> indicating whether an element with the specified configuration name exists or not.
 * @param name Required. The key of the element to test for presence in the Map object.`
 * @returns <span class="token punctuation">{</span><span class="token keyword">boolean</span><span class="token punctuation">}</span>
 */
<span class="token function">has</span><span class="token punctuation">(</span>name<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">boolean</span><span class="token punctuation">;</span>
/**
 * The `<span class="token function">get</span><span class="token punctuation">(</span><span class="token punctuation">)</span> method returns a specified element <span class="token keyword">from</span> a loggerAppenders.
 * @param name Required. The configuration of the element to return <span class="token keyword">from</span> the Map object.
 * @returns <span class="token punctuation">{</span><a href="/api/logger/logger/class/ILoggerAppender.html"><span class="token">ILoggerAppender</span></a><span class="token punctuation">}</span>
 */
<span class="token function">get</span><span class="token punctuation">(</span>name<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <a href="/api/logger/logger/class/ILoggerAppender.html"><span class="token">ILoggerAppender</span></a><span class="token punctuation">;</span>
/**
 * The `<span class="token function">set</span><span class="token punctuation">(</span><span class="token punctuation">)</span>` method adds or updates an element with a specified key and value to a loggerAppenders object.
 * @param name Required. The key of the element to add to the loggerAppenders object.
 * @param config Required. The config of the element to add to the loggerAppenders object.
 * @returns <span class="token punctuation">{</span>LoggerAppender<span class="token punctuation">}</span>
 */
<span class="token function">set</span><span class="token punctuation">(</span>name<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">,</span> config<span class="token punctuation">:</span> <a href="/api/logger/appenders/interfaces/IAppenderConfiguration.html"><span class="token">IAppenderConfiguration</span></a><span class="token punctuation">)</span><span class="token punctuation">:</span> LoggerAppenders<span class="token punctuation">;</span>
/**
 * Remove all configuration that match with the `name`.
 * @param name Required. The key of the element to remove <span class="token keyword">from</span> the loggerAppenders object.
 * @returns <span class="token punctuation">{</span><span class="token keyword">boolean</span><span class="token punctuation">}</span> Returns true if an element in the Map object existed and has been removed<span class="token punctuation">,</span> or false if the element does not exist.
 */
<span class="token function">delete</span><span class="token punctuation">(</span>name<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">boolean</span><span class="token punctuation">;</span>
/**
 * The `<span class="token function">clear</span><span class="token punctuation">(</span><span class="token punctuation">)</span> method removes all elements <span class="token keyword">from</span> a loggerAppenders object.
 */
<span class="token function">clear</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>
/**
 * The `<span class="token function">forEach</span><span class="token punctuation">(</span><span class="token punctuation">)</span>` method executes a provided function once per each key/value pair in the loggerAppenders object<span class="token punctuation">,</span> in insertion order.
 * @param callback Function to execute for each element.
 * @param thisArg Value to use <span class="token keyword">as</span> this when executing callback.
 */
<span class="token function">forEach</span><span class="token punctuation">(</span>callback<span class="token punctuation">:</span> <span class="token punctuation">(</span>value<span class="token punctuation">:</span> <a href="/api/logger/logger/class/ILoggerAppender.html"><span class="token">ILoggerAppender</span></a><span class="token punctuation">,</span> key<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">,</span> map<span class="token punctuation">:</span> Map&lt;<span class="token keyword">string</span><span class="token punctuation">,</span> <a href="/api/logger/logger/class/ILoggerAppender.html"><span class="token">ILoggerAppender</span></a>&gt;<span class="token punctuation">)</span> =&gt; <span class="token keyword">void</span><span class="token punctuation">,</span> thisArg?<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>
/**
 *
 * @returns <span class="token punctuation">{</span>Array<span class="token punctuation">}</span>
 */
<span class="token function">toArray</span><span class="token punctuation">(</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 punctuation">]</span><span class="token punctuation">;</span>
/**
 * Return all appenders that match with the given loggingLevel.
 * @param loggingLevel
 * @returns <span class="token punctuation">{</span><span class="token punctuation">[</span><a href="/api/logger/appenders/class/BaseAppender.html"><span class="token">BaseAppender</span></a><span class="token punctuation">]</span><span class="token punctuation">}</span>
 */
<span class="token function">byLogLevel</span><span class="token punctuation">(</span>loggingLevel<span class="token punctuation">:</span> <a href="/api/logger/core/LogLevel.html"><span class="token">LogLevel</span></a><span class="token punctuation">)</span><span class="token punctuation">:</span> <a href="/api/logger/appenders/class/BaseAppender.html"><span class="token">BaseAppender</span></a><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>

}

# Members

get size(): number;

has(name: string): boolean;
Param Type Description
name string Required. The key of the element to test for presence in the Map object.`

The `has() method returns a boolean indicating whether an element with the specified configuration name exists or not.


get(name: string): ILoggerAppender;
Param Type Description
name string Required. The configuration of the element to return from the Map object.

The `get() method returns a specified element from a loggerAppenders.


set(name: string, config: IAppenderConfiguration): LoggerAppenders;
Param Type Description
name string Required. The key of the element to add to the loggerAppenders object. config

The set() method adds or updates an element with a specified key and value to a loggerAppenders object.


delete(name: string): boolean;
Param Type Description
name string Required. The key of the element to remove from the loggerAppenders object.

Remove all configuration that match with the name.


clear(): void;

The `clear() method removes all elements from a loggerAppenders object.


forEach(callback: (value: ILoggerAppender, key: string, map: Map<string, ILoggerAppender>) => void, thisArg?: any): void;
Param Type Description
callback (value: <a href="/api/logger/logger/class/ILoggerAppender.html"><span class="token">ILoggerAppender</span></a> Function to execute for each element. thisArg

The forEach() method executes a provided function once per each key/value pair in the loggerAppenders object, in insertion order.


toArray(): any[];

byLogLevel(loggingLevel: LogLevel): BaseAppender[];

Return all appenders that match with the given loggingLevel.

Other topics