| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
npm install gelf
const Gelf = require('gelf')
const gelf = new Gelf() // with default config
gelf.on('error', (err) => {
console.log('ouch!', err)
})const Gelf = require('gelf')
const gelf = new Gelf({
graylogPort: 12201,
graylogHostname: '127.0.0.1',
connection: 'wan',
maxChunkSizeWan: 1420,
maxChunkSizeLan: 8154
})// send just a shortmessage
gelf.emit('gelf.log', 'myshortmessage')
// send a full message
const message = {
"version": "1.0",
"host": "www1",
"short_message": "Short message",
"full_message": "Backtrace here\n\nmore stuff",
"timestamp": Date.now() / 1000,
"level": 1,
"facility": "payment-backend",
"file": "/var/www/somefile.rb",
"line": 356,
"_user_id": 42,
"_something_else": "foo"
}
gelf.emit('gelf.log', message);Emitted for errors
Logs a short or full message
Closes the UDP Socket
Opens the Socket
npm run test
| Back | FazBrowse Home | New Git URL |