# 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: 10/26/2023, 6:30:07 AM

Other topics