fluent-logger
Advanced tools
Comparing version 0.2.6 to 0.3.0
@@ -0,3 +1,4 @@ | ||
'use strict'; | ||
var FluentSender = require('./sender').FluentSender; | ||
var sender = new FluentSender('debug'); | ||
@@ -4,0 +5,0 @@ |
@@ -0,1 +1,2 @@ | ||
'use strict'; | ||
/** | ||
@@ -2,0 +3,0 @@ * log4js appender support |
@@ -0,4 +1,5 @@ | ||
'use strict'; | ||
var util = require('util'); | ||
var EventEmitter = require('events').EventEmitter; | ||
var pack = require('msgpack').pack; | ||
var pack = require('msgpack5')().encode; | ||
var net = require('net'); | ||
@@ -83,4 +84,3 @@ | ||
if (typeof time != "number") { | ||
var dateTime = time || new Date(); | ||
time = dateTime.getTime() / this._timeResolution; | ||
time = (time ? time.getTime() : Date.now()) / this._timeResolution; | ||
} | ||
@@ -87,0 +87,0 @@ |
@@ -0,4 +1,5 @@ | ||
'use strict'; | ||
var net = require('net'); | ||
var fs = require('fs'); | ||
var msgpack = require('msgpack'); | ||
var msgpack = require('msgpack5')(); | ||
@@ -16,4 +17,6 @@ function MockFluentdServer(){ | ||
}); | ||
var ms = new msgpack.Stream(socket); | ||
ms.on('msg', function(m){ | ||
var decoder = msgpack.decoder(); | ||
socket.pipe(decoder); | ||
decoder.on('data', function(m) { | ||
self._received.push({ | ||
@@ -20,0 +23,0 @@ tag: m[0], |
{ | ||
"name": "fluent-logger", | ||
"version": "0.2.6", | ||
"main": "./lib/index.js", | ||
"scripts": { | ||
"test": "./node_modules/.bin/mocha -t 10000 --recursive" | ||
}, | ||
"author": { | ||
"name": "Yohei Sasaki", | ||
"email": "yssk22@gmail.com", | ||
"url": "http://github.com/yssk22" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "http://github.com/fluent/fluent-logger-node" | ||
}, | ||
"dependencies": { | ||
"msgpack": "" | ||
}, | ||
"devDependencies": { | ||
"mocha": "", | ||
"chai": "", | ||
"log4js": "", | ||
"async": "" | ||
}, | ||
"licenses": [{ | ||
"type" : "Apache", | ||
"url" : "http://www.apache.org/licenses/LICENSE-2.0.html" | ||
}], | ||
"keywords": ["logger", "fluent"] | ||
"name": "fluent-logger", | ||
"version": "0.3.0", | ||
"main": "./lib/index.js", | ||
"scripts": { | ||
"test": "./node_modules/.bin/mocha -t 10000 --recursive" | ||
}, | ||
"author": { | ||
"name": "Yohei Sasaki", | ||
"email": "yssk22@gmail.com", | ||
"url": "http://github.com/yssk22" | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "Eduardo Silva", | ||
"email": "eduardo@treasure-data.com", | ||
"url": "http://edsiper.linuxchile.cl" | ||
} | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "http://github.com/fluent/fluent-logger-node" | ||
}, | ||
"engines": { | ||
"node": ">=0.10.30 < 4" | ||
}, | ||
"dependencies": { | ||
"msgpack": "0.2.7", | ||
"msgpack5": "^3.1.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "", | ||
"chai": "", | ||
"log4js": "", | ||
"async": "" | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "Apache", | ||
"url": "http://www.apache.org/licenses/LICENSE-2.0.html" | ||
} | ||
], | ||
"keywords": [ | ||
"logger", | ||
"fluent", | ||
"fluentd" | ||
] | ||
} |
@@ -1,4 +0,4 @@ | ||
# fluent-logger for node.js | ||
# fluent-logger for Node.js | ||
fluent-logger implementation for node.js inspired by [fluent-logger-python]. | ||
fluent-logger implementation for Node.js inspired by [fluent-logger-python]. | ||
@@ -10,3 +10,3 @@ [![Build Status](https://secure.travis-ci.org/fluent/fluent-logger-node.png?branch=master,develop)](http://travis-ci.org/fluent/fluent-logger-node) | ||
$ npm install fluent-logger | ||
## Prerequistes | ||
@@ -18,3 +18,3 @@ | ||
### Send an event record to fluentd | ||
### Send an event record to Fluentd | ||
@@ -26,19 +26,19 @@ Singleton style | ||
logger.configure('tag', { | ||
host: 'localhost', | ||
host: 'localhost', | ||
port: 24224, | ||
timeout: 3.0 | ||
}); | ||
// send an event record with 'tag.label' | ||
logger.emit('label', {record: 'this is a log'}); | ||
Instance style | ||
var logger = require('fluent-logger').createFluentSender('tag', { | ||
host: 'localhost', | ||
host: 'localhost', | ||
port: 24224, | ||
timeout: 3.0 | ||
}); | ||
The emit method has following signature | ||
@@ -55,3 +55,3 @@ | ||
Befre using [log4js] support, you should install it IN YOUR APPLICATION. | ||
Before using [log4js] support, you should install it IN YOUR APPLICATION. | ||
@@ -65,3 +65,3 @@ | ||
})); | ||
var logger = log4js.getLogger('foo'); | ||
@@ -76,1 +76,5 @@ logger.info('this log record is sent to fluent daemon'); | ||
## Abour NodeJS versions | ||
This package is compatible with NodeJS versions < 4.0. If you are using newer versions of NodeJS (e.g: 4.1), please checkout the branch [nodejs-4](https://github.com/fluent/fluent-logger-node/tree/nodejs-4). |
@@ -118,7 +118,13 @@ var expect = require('chai').expect; | ||
s.emit('foo', 'bar', function(){ | ||
// connected. | ||
// capture ECONNRESET when closing server | ||
s.on('error', function(err){ | ||
if (err.code === 'ECONNRESET') return; | ||
throw err; | ||
}); | ||
server.close(function(){ | ||
// waiting for the server closing all client socket. | ||
(function waitForUnwritable(){ | ||
if( !s._socket.writable ){ | ||
if( !(s._socket && s._socket.writable) ){ | ||
runServer(function(_server2, finish){ | ||
@@ -257,3 +263,2 @@ s.port = _server2.port; // in actuall case, s.port does not need to be updated. | ||
// Internal behavior test. | ||
@@ -260,0 +265,0 @@ it('should not flush queue if existing connection is unavailable.', function(done){ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
32673
12
570
0
75
2
3
+ Addedmsgpack5@^3.1.0
+ Addedbl@1.2.3(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedmsgpack@0.2.7(transitive)
+ Addedmsgpack5@3.6.1(transitive)
+ Addednan@1.9.0(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedsafe-buffer@5.1.25.2.1(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
- Removedmsgpack@1.0.3(transitive)
- Removednan@2.22.0(transitive)
Updatedmsgpack@0.2.7