winstonjs / node-loggly

A client implementation for Loggly in node.js
http://github.com/winstonjs/node-loggly
Other
233 stars 81 forks source link

Use bulk endpoint for arrays #33

Closed freeall closed 10 years ago

freeall commented 11 years ago

Fixes #31

With this change node-loggly can support the bulk endpoint from Loggly, http://www.loggly.com/docs/api-sending-data/#bulk.

Changes that the .log method can now take an array client.log([ {iam:'number1'}, {iam:'number 2'} ]).

jcrugzz commented 11 years ago

@freeall can you add a test for this?

freeall commented 11 years ago

I didn't add one since there's no way to check for the result on Loggly. The test would do the same as the one already there. Basically just check we're passing an array and that the response is ok. You still want it?

freeall commented 11 years ago

I've added a test now.

Please note that when I ran the tests some of them them failed, but not the one I wrote. This also happened if I did a clean clone.

  When using the node-loggly client the search() method when searching with chaining
    ✗ should return a set of valid search results
        » expected null, got { stack: 'Error: Loggly Error (500): Internal Server Error\n    at Request._callback (/Users/freeall/workspace/node_modules/node-loggly/lib/loggly/common.js:133:25)\n    at Request.self.callback (/Users/freeall/workspace/node_modules/node-loggly/node_modules/request/request.js:129:22)\n    at Request.EventEmitter.emit (events.js:98:17)\n    at Request.options.Emitter.emit (/Users/freeall/workspace/node_modules/node-loggly/node_modules/vows/lib/vows.js:237:24)\n    at Request.<anonymous> (/Users/freeall/workspace/node_modules/node-loggly/node_modules/request/request.js:873:14)\n    at Request.EventEmitter.emit (events.js:117:20)\n    at Request.options.Emitter.emit (/Users/freeall/workspace/node_modules/node-loggly/node_modules/vows/lib/vows.js:237:24)\n    at IncomingMessage.<anonymous> (/Users/freeall/workspace/node_modules/node-loggly/node_modules/request/request.js:824:12)\n    at IncomingMessage.EventEmitter.emit (events.js:117:20)\n    at IncomingMessage.options.Emitter.emit (/Users/freeall/workspace/node_modules/node-loggly/node_modules/vows/lib/vows.js:237:24)', arguments: undefined, type: undefined, message: 'Loggly Error (500): Internal Server Error' } // common.js:133
  When using the node-loggly client the search() method when searching without chaining
    ✗ should return a set of valid search results
        » expected null, got . // helpers.js:52

✗ Broken » 10 honored ∙ 2 broken (9.392s)
freeall commented 10 years ago

Ping :) Would like to use this feature. Is it possible to merge it soon?

jcrugzz commented 10 years ago

@freeall if airport wifi allows, Ill get this up and published. Thanks for the contribution!

freeall commented 10 years ago

Great, thanks!

christiaanwesterbeek commented 10 years ago

There's a bug with this implementation. Tags are not being sent. See issue https://github.com/nodejitsu/node-loggly/issues/35