/logdna-bunyan

LogDNA's Node.js logging module with support for Bunyan

Primary LanguageJavaScriptMIT LicenseMIT

Node.js Bunyan library for logging to LogDNA

Build Status


Install

$ npm install --save logdna-bunyan

API

Please see the logdna npm module for the API.

Bunyan Stream

This module also provides a transport object, which can be added to bunyan using:

let LogDNAStream = require('logdna-bunyan').BunyanStream;

let logDNA = new LogDNAStream({
  key: apikey
});

var logger = bunyan.createLogger({
  name: "My Application",
  streams: [
  	{ stream: process.stdout },
    { stream: logDNA,
      type: 'raw'
    }
  ]
});


logger.info('Starting application on port %d', app.get('port'));

NOTE: You must use the raw stream type

License

MIT © LogDNA

Happy Logging!