# sprinthive-logster

> An internal SprintHive package which is a wrapper around winston and winston-logstash to append some default meta data to all log messages.

Latest version **0.0.3** (published 2018-07-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install sprinthive-logster
pnpm add sprinthive-logster
yarn add sprinthive-logster
bun add sprinthive-logster
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2018-07-05 |
| First published | 2018-07-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jon Lai Lam |
| Maintainers | jonlailam |
| Keywords | winston, winston-logstash |

## Links

- npm: https://www.npmjs.com/package/sprinthive-logster
- npm.io page: https://npm.io/package/sprinthive-logster

## Dependencies (2)

- [winston](https://npm.io/package/winston.md) ^2.4.3
- [winston-logstash](https://npm.io/package/winston-logstash.md) ^0.4.0

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

- 0.0.3 (latest) — 2018-07-05
- 0.0.2 — 2018-07-04
- 0.0.1 — 2018-07-04

## README

# sprinthive-logster

The intention of this package is to be used internally at SprintHive, 
to send log messages to a fluentd deamon over TCP.

This project makes it easy to send extra meta data along with every 
log message.

## Basic Usage

By default sprinthive-logster only prints out to the console.

    mkdir logster-usage-test
    cd logster-usage-test
                  
    npm i sprinthive-logster
    
    # create index.js file with the following contents
    const logster = require("sprinthive-logster");
    const log = logster();
    log.debug("Hellow world!");

    # run the app       
    node basic.js 
    # this will output
    > debug: Hello world!

To enable the sending of logs to a TCP socket and sending extra metadata, try the following:

    # create testTcp.js file with the following contents
    const logster = require("sprinthive-logster");
    const log = logster({tcpEnabled: true, meta: {appName: "UsageTest"}});
    
    log.debug("Hello world!");
    
To run it open one terminal and use net cat to receive the tcp data. 
    
    nc -l 5710
    
Then run the testTcp.js

    node testTcp.js   
    
    # The log message Hello World! is sent to the console and the TCP socket.
    # On the console you will see
    debug: Hello world! appName=UsageTest

    # In the net cat console you should see
    {"appName":"UsageTest","level":"debug","message":"Hello world!","label":"winston"}

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