# Connect Appender

The module let developer use external logger that implement the classic logger methods (info, debug, warn, trace, error, fatal).

npm install --save @tsed/logger-connect
1

# Configuration

  • type - connect
  • options.logger - your instance logger

# Example

import {$log} from "@tsed/logger";
import "@tsed/logger-connect";

$log.clear()
$log.appenders.set("channel", {
  type: "connect",
  logger: {
    info: (obj) => console.log(obj),
    warn: (obj) => console.warn(obj),
    debug: (obj) => console.debug(obj),
    trace: (obj) => console.trace(obj),
    error: (obj) => console.error(obj),
  }
});

$log.info({tags: ["my-tag-1", "my-tag-2"]}, "Some message");
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

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

Other topics