Socket
Socket
Sign inDemoInstall

log4js-logstash-tcp

Package Overview
Dependencies
0
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    log4js-logstash-tcp

This is 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.


Version published
Weekly downloads
1.9K
increased by6.53%
Maintainers
2
Install size
147 kB
Created
Weekly downloads
 

Readme

Source

log4js-logstash-tcp

Build Status FOSSA Status

This is 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

Installation

You can install log4js-logstash-tcp by adding this .git url to your package.json or do a npm install log4js-logstash-tcp

Usage: logstash configuration

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

input {
	tcp {
		codec => "json"
		port => 5050
		type => "tcp-input"
	}
}

Usage: log4js configuration

Plain javascript

    var log4js = require('log4js');
    log4js.configure({
        "appenders": [
            {
                "category": "tests",
                "type": "log4js-logstash-tcp",
                "host": "localhost",
                "port": 5050,
                "fields": {
                    "instance": "MyAwsInstance",
                    "source": "myApp",
                    "environment": "development"
                }
            },
            {
                "category": "tests",
                "type": "console"
            }
        ],
        "levels": {
            "tests":  "DEBUG"
        }
    });

    var log = log4js.getLogger('tests');
    // adding context and add it as additional field to each log entry
    log.addContext('customer', {id: 123, name: 'John Doe'});

    log.error('hello hello');

License

FOSSA Status

Keywords

FAQs

Last updated on 21 Apr 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc