# 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.

Latest version **2.0.5** (published 2023-04-21) · 0 weekly downloads

## Install

```sh
npm install log4js-logstash-tcp
pnpm add log4js-logstash-tcp
yarn add log4js-logstash-tcp
bun add log4js-logstash-tcp
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.5 |
| Published | 2023-04-21 |
| First published | 2017-12-13 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.4.0 |
| Dependencies | 0 |
| Unpacked size | 147.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Sebastian Lagemann |
| Maintainers | degola, tothal99 |
| Keywords | logstash, log4js, appender |

## Links

- npm: https://www.npmjs.com/package/log4js-logstash-tcp
- Repository: https://github.com/Degola/log4js-logstash-tcp
- Homepage: https://github.com/Degola/log4js-logstash-tcp#readme
- Issues: https://github.com/Degola/log4js-logstash-tcp/issues
- npm.io page: https://npm.io/package/log4js-logstash-tcp

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 2.0.5 (latest) — 2023-04-21
- 2.0.4 — 2023-03-09
- 2.0.3 — 2021-08-03
- 2.0.2 — 2021-08-03
- 2.0.1 — 2021-08-03
- 2.0.0 — 2020-03-17
- 1.0.8 — 2018-07-20
- 1.0.7 — 2018-07-20
- 1.0.6 — 2018-07-19
- 1.0.5 — 2018-07-19
- 1.0.4 — 2018-07-19
- 1.0.3 — 2018-07-19
- 1.0.2 — 2018-07-19
- 1.0.1 — 2018-02-03
- 1.0.0 — 2017-12-13

## README

log4js-logstash-tcp
===============
[![Build Status](https://app.travis-ci.com/Degola/log4js-logstash-tcp.svg?branch=master)](https://app.travis-ci.com/Degola/log4js-logstash-tcp)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FAigent%2Flog4js-logstash-tcp.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FAigent%2Flog4js-logstash-tcp?ref=badge_shield)

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
```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](https://app.fossa.com/api/projects/git%2Bgithub.com%2FAigent%2Flog4js-logstash-tcp.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FAigent%2Flog4js-logstash-tcp?ref=badge_large)

---
_Source: https://npm.io/package/log4js-logstash-tcp · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
