Giter Club home page Giter Club logo

kafka-logger's Introduction

kafka-logger

A kafka transport for winston

Usage

var winston = require('winston');

winston.transports.Kafka = require('kafka-logger');

winston.add(winston.transports.Kafka, options);

The Kafka transport currently uses node-kafka-rest-client. The Kafka transport takes the following options:

  • topic - The Kafka topic to publish to.
  • proxyHost - The Kafka REST Proxy host to publish to.
  • proxyPort - The Kafka REST Proxy port to publish to.
  • properties - Top-level properties that should be added to the JSON object published to the kafka topic; useful if multiple processes use the same topic
  • dateFormats - An object of date formats to use; keys are the names of the keys the format should be added to, values are the names of the formats (useful for cross-language usage of the logs to reduce transforms on the consumers). These formats are: epoch (time in sec since Jan 1, 1970), jsepoch (time in ms since Jan 1, 1970), pyepoch (time in sec since Jan 1, 1970, but floating point with ms resolution), iso (ISO datestring format)

Install

npm install winston kafka-logger

Testing

npm test

There is a kafka.js that will talk to kafka if it is running and just gets skipped if its not running.

To run kafka run zookeeper & kafka with npm run start-zk and npm run start-kafka

MIT Licenced

kafka-logger's People

Contributors

raynos avatar xiangfu0 avatar mmchen avatar xhl1988 avatar yanjunh avatar uberesch avatar cloudxane avatar qix- avatar matt-esch avatar rf avatar huawangpp avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.