Anyone a big fan of npm tracer?

While bunyan is the default choice for logging in Node. “tracer” is still downloaded 30,000 times every week. If you are a big fan of bunyan. Tracer can work with Bunyan and you can still send those logs to loggly

Here is an example of some quick and dirty code that does the job:

var bunyan = require('bunyan');
var Bunyan2Loggly = require('bunyan-loggly').Bunyan2Loggly;


/**
 * bunyan loggly
 */

var blog = bunyan.createLogger({
  name: '',
  streams: [
    {
      type: 'raw',
      stream: new Bunyan2Loggly(config.LOGGLY_SETTINGS)
    }
    //,{
    //  stream: process.stdout,
    //  level: "debug"
    //}

  ]
});


var log_conf = {
  transport: function (data) {

    try {
      var objToLog = {
        line: data.line,
        file: data.file,
        method: data.method,
        message: data.message
      }
      blog.info(objToLog);
      //console.log(objToLog);
      console.log(data.output);
    } catch (e) {
      console.log(e)
    }

  }
}

var logger = require('tracer').console(log_conf);