Skip to content

A simple log appender for log4js that sends the data to logstash by kafka.

License

Notifications You must be signed in to change notification settings

beyond5959/log4js-logstash-kafka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

log4js-logstash-kafka

A simple log appender for log4js that sends the data to logstash by kafka.

Installation

npm install log4js-logstash-kafka --save

Usage: logstash configuration

In the "input" part of the logstash server conf :

input {
  kafka {
    topic_id => "YOURTOPIC"
    codec => json
  }
}

Usage: log4js configuration

Plain javascript

  const log4js = require('log4js');
  log4js.configure({
      appenders: [{
          type: "log4js-logstash-kafka",
          topic: "YOURTOPIC"
      }]
  });

  const logger = log4js.getLogger();

  logger.debug('hello');

About

A simple log appender for log4js that sends the data to logstash by kafka.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published