node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



A client implementation for Sumologic in node.js.


Very simple to use. First of all, set up an account with Sumologic

Create an HTTP Collector endpoint


alt tag

Now write a few lines of code to call logs-to-sumologic:

const Sumologic = require('logs-to-sumologic');
var collectorCode = 'YOUR_COLLECTOR CODE'
var endpoint = 'YOUR_ENDPOINT'
// '' 
var url = endpoint + collectorCode;
const sumologic = Sumologic.createClient({
  url: url,
  name: "SumoHttpCollector",   // Custom Source Name -  optional 
  host: "",      // Custom Source Host - optional 
  category: "env/host/service" // Custom Source Category - optional 
 * More info about name,host and category options are in section 
 *  "Other Supported HTTP Headers"
 *  at
var cb = function (err, res) {
  if (err) {
    // handle error 
  // handle success 
// contrived examples: 
// single log message 
var log = {test: "test only"};
sumologic.log(JSON.stringify(log), cb);
// or 
sumologic.log(log, cb);
// bulk 
var logs = [{test1: "test only"}, {test2: "test only"}];
sumologic.log(JSON.stringify(logs), cb);
// or 
sumologic.log(logs, cb);

Optionally, setup a live tail to your HTTP Collector endpoint

You should see your logs appearing, eg.

alt tag


Further information

Please see here for further information on uploading data to an HTTP Source using Sumologic.