@tele2se/log4js-logstash-tcp

1.0.1 • Public • Published

log4js-logstash-tcp

FOSSA Status

Based on the works of https://github.com/Aigent/log4js-logstash-tcp. Initially, a copy of the logstashUDP appender but instead sending via UDP send via TCP to avoid the maximum 64k bytes message size with the logstashUDP appender.

This fork was created to change the serialization of message to include stack traces. This changes the behaviour significantly from the original version.

Usage: log4js configuration

Plain javascript

const log4js = require("log4js");

log4js.configure({
  appenders: {
    console: {
      type: "console",
    },
    logstash: {
      type: "@tele2se/log4js-logstash-tcp",
      host: "<LOGSTASH_HOST>",
      port: "<PORT>",
      fields: {
        app_name: "application-name",
        index: "es-index",
      },
    },
  },
  categories: {
    default: {
      appenders: ["console", "logstash"],
      level: "debug",
    },
  },
});

const logger = log4js.getLogger();

module.exports = logger;

License

FOSSA Status

Package Sidebar

Install

npm i @tele2se/log4js-logstash-tcp

Weekly Downloads

1

Version

1.0.1

License

none

Unpacked Size

28.4 kB

Total Files

7

Last publish

Collaborators

  • kennethtele2
  • thergora
  • tele2stef
  • mrlorentz
  • lenkan
  • parste