# Appenders

Appenders serialise log events to some form of output. They can write to files, send emails, send data over the network. All appenders have a type which determines which appender gets used. For example:

# Example

import {Logger} from "@tsed/logger";

const logger = new Logger("loggerName");

logger.appenders
  .set({
    type: "stdout",
    level: ["debug", "info", "trace"]
  })
  .set({
    type: "stderr",
    level: ["error", "fatal", "warn"]
  })
  .set({
    type: "file",
    filename: "logfile.log"
  });
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

TIP

This example defines three appenders named stdout, stderr and file.

# Core Appenders

The following appenders are included with Ts.Logger.

Loading in progress...

Last Updated: 8/23/2022, 6:24:43 PM

Other topics