@hinted-public/winston-kafka-transport

2.0.1 • Public • Published

Kafka transport for Winston v3

Flexible and simple kafka transport for winston v3

Usage

Install package

yarn add @hinted-public/winston-kafka-transport

or

npm install @hinted-public/winston-kafka-transport

Using KafkaTransport for winston

const winston = require('winston');
const KafkaTransport = require('@hinted-public/winston-kafka-transport');

winston.add(
  new KafkaTransport({
    level: 'info',
    format: format.combine(...traceFormats),
    meta: {},
    kafkaOptions: {
      brokers: ['localhost:9092'],
      clientId: 'winston-kafka-logger',
    },
    topic: kafkaTopic,
    name: 'WinstonLogs',
    formatter: JSON.stringify,
  }),
);

Readme

Keywords

Package Sidebar

Install

npm i @hinted-public/winston-kafka-transport

Weekly Downloads

0

Version

2.0.1

License

MIT

Unpacked Size

10.5 kB

Total Files

4

Last publish

Collaborators

  • hinted