Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lemedi/bristol-graylog
https://github.com/lemedi/bristol-graylog
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lemedi/bristol-graylog
- Owner: leMedi
- Created: 2019-02-14T15:58:59.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-14T16:54:23.000Z (almost 6 years ago)
- Last Synced: 2024-04-29T23:08:41.048Z (9 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# [Graylog](https://www.graylog.org) transport for [Bristol](https://github.com/TomFrost/bristol)
Bristol transport to send events and errors to Graylog.
## Installation
You will need to install this package, as well as `[node-graylog2](https://www.npmjs.com/package/graylog2)`, which is the Graylog node.js client.
```
npm install --save bristol-graylog graylog2 bristol
```## Getting started
```js
const bristol = require('bristol');
const graylog2 = require("graylog2");;
const bristolGraylog = require('bristol-graylog');const target = bristolGraylog({
client: new graylog2.graylog({
servers: [
{ 'host': '127.0.0.1', port: 12201 }
],
hostname: 'server.name', // the name of this host
// (optional, default: os.hostname())
facility: 'Node.js', // the facility for these log messages
// (optional, default: "Node.js")
bufferSize: 1350 // max UDP packet size, should never exceed the
// MTU of your system (optional, default: 1400)
})
})// Add as a target with the included formatter.
bristol.addTarget(target)// Try it out
bristol.debug('here come dat boi');
bristol.info('watch him rollin watch him go');
bristol.warn('he be rollin', { rollinWhere: 'down the street' });
bristol.error(new Error('o shit waddup'));
```
# AuthorMehdi El-Haij - [@leMedi](https://github.com/leMedi)