Skip to content

Instantly share code, notes, and snippets.

@thinkjson
Created February 21, 2014 02:12
Show Gist options
  • Select an option

  • Save thinkjson/9127517 to your computer and use it in GitHub Desktop.

Select an option

Save thinkjson/9127517 to your computer and use it in GitHub Desktop.
Loggly example
var http = require('http');
var options = {
host: 'logs.loggly.com',
port: 80,
path: '/inputs/{input_id}',
method: 'POST'
};
exports.write = function(data) {
var req = http.request(options, function(res) {});
req.on('error', function(e) {
console.log('Could not log request: ' + e.message);
});
req.write(data);
req.end();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment