1.1.0 • Published 3 years ago

winston-rxjs v1.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
3 years ago

winston-rxjs

RxJS.Subject Transport for Winston

Installation

$ npm install winston-rxjs

Usage

const winston = require("winston");
const { Subject } = require("rxjs");

const logSubject = new Subject();
const winstonRxJSTransport = require("winston-rxjs");

const logger = winston.createLogger({
  level: "debug",
  format: winston.format.json(),
  transports: [new winstonRxJSTransport({ subject: logSubject })],
});

logSubject.subscribe({ next: (logEntry) => console.log(logEntry); });

The transport options are:

  • subject - RxJS.Subject entity (default: creates a new one by itself, at subject property)