Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 1.41 KB

File metadata and controls

40 lines (32 loc) · 1.41 KB

nightingale-winston-adapter

Winston adapter handler for nightingale

Install

npm install --save nightingale nightingale-winston-adapter
npm install --save winston-logstash # example with winston-logstash

How to use

import { addGlobalHandler, Level } from "nightingale";
import WinstonAdapterHandler from "nightingale-winston-adapter";
import LogStash from "winston-logstash";

// create transport
const logmaticTransport = new Logstash({
  port: 0000,
  host: "api.logmatic.io",
  meta: { logmaticKey: "xxxxxxxx" },
  node_name: "my node name",
});

// add the transport as a nightingale handler for all loggers
addGlobalHandler(new WinstonAdapterHandler(logmaticTransport, Level.ALL));