Skip to content
Snippets Groups Projects
Commit 3c28a499 authored by Thomas Bock's avatar Thomas Bock :speech_balloon:
Browse files

+ gelf log stream example

parent f5ae0f0f
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ const io = require('socket.io'); ...@@ -7,6 +7,7 @@ const io = require('socket.io');
const inspect = require('util').inspect; const inspect = require('util').inspect;
const bunyan = require('bunyan'); const bunyan = require('bunyan');
const bunyanDebugStream = require('bunyan-debug-stream'); const bunyanDebugStream = require('bunyan-debug-stream');
const BunyanToGelfStream = require('bunyan-gelf');
function SocketStream(options) { function SocketStream(options) {
this.writable = true; this.writable = true;
...@@ -53,7 +54,14 @@ var logger = bunyan.createLogger({ ...@@ -53,7 +54,14 @@ var logger = bunyan.createLogger({
showDate: formateDate, showDate: formateDate,
out: socketStream out: socketStream
}) })
}], },
{
type: 'raw',
stream: new BunyanToGelfStream({
host: '172.30.56.22',
port: 12201,
})
}],
//serializers: bunyanDebugStream.serializers //serializers: bunyanDebugStream.serializers
}); });
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
"dependencies": { "dependencies": {
"bunyan": "^1.8.12", "bunyan": "^1.8.12",
"bunyan-debug-stream": "^2.0.0", "bunyan-debug-stream": "^2.0.0",
"bunyan-gelf": ">=1.0.0",
"crc": "^3.8.0", "crc": "^3.8.0",
"h5.modbus": "^0.1.0", "h5.modbus": "^0.1.0",
"node-xlsx": "^0.12.1", "node-xlsx": "^0.12.1",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment