# gelf-stream

> A stream to send JS objects to a Graylog2 server (in GELF format)

Latest version **1.1.1** (published 2016-05-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install gelf-stream
pnpm add gelf-stream
yarn add gelf-stream
bun add gelf-stream
```

## 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 | 1.1.1 |
| Published | 2016-05-07 |
| First published | 2013-01-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 30 |
| Author | Michael Hart |
| Maintainers | hichaelmart |
| Keywords | gelf, stream, graylog, graylog2, bunyan |

## Links

- npm: https://www.npmjs.com/package/gelf-stream
- Repository: https://github.com/mhart/gelf-stream
- Homepage: https://github.com/mhart/gelf-stream#readme
- Issues: https://github.com/mhart/gelf-stream/issues
- npm.io page: https://npm.io/package/gelf-stream

## Dependencies (1)

- [gelfling](https://npm.io/package/gelfling.md) ^0.3.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

- 1.1.1 (latest) — 2016-05-07
- 1.1.0 — 2016-01-13
- 1.0.3 — 2015-06-11
- 1.0.2 — 2015-06-11
- 1.0.1 — 2015-03-12
- 1.0.0 — 2015-02-16
- 0.2.4 — 2014-05-22
- 0.2.3 — 2014-05-09
- 0.2.2 — 2013-01-19
- 0.2.1 — 2013-01-17
- 0.2.0 — 2013-01-17
- 0.0.1 — 2013-01-17

## README

gelf-stream
-----------

[![Build Status](https://secure.travis-ci.org/mhart/gelf-stream.png?branch=master)](http://travis-ci.org/mhart/gelf-stream)

A node.js stream to send JS objects to a
[Graylog2](http://graylog2.org/) server (in
[GELF](http://graylog2.org/resources/gelf) format).

Also provides a stream that can be used directly in
[Bunyan](https://github.com/trentm/node-bunyan) and provides
a number of sane mappings.

Example
-------

```javascript
var split = require('split'),
    bunyan = require('bunyan'),
    gelfStream = require('gelf-stream')

// gelf-stream comes with Bunyan support

var stream = gelfStream.forBunyan('localhost')

var log = bunyan.createLogger({name: 'foo', streams: [{type: 'raw', stream: stream}]})

log.info('Testing Bunyan') // will be sent to the Graylog2 server on localhost

log.error(new Error('Oh noes!')) // will extract file/line numbers too

stream.end() // Bunyan doesn't currently end the stream when the program has finished

// Or you can use it to stream any sort of object/string

process.stdin
  .pipe(split()) // split into lines
  .pipe(gelfStream.create('localhost', {defaults: {level: 6}}))

process.stdin.resume()
```

API
---

### gelfStream.create([host], [port], [options])

### gelfStream.forBunyan([host], [port], [options])


Installation
------------

With [npm](http://npmjs.org/) do:

```
npm install gelf-stream
```

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