Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

logdna-bunyan

logdna6.9kSEE LICENSE IN LICENSE2.0.3

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

logdna, logs, logging, bunyan, logdna.com, logger, node, nodejs

readme

[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors-)

Node.js Bunyan library for logging to LogDNA


Install

$ npm install --save logdna-bunyan

API

Please see @logdna/logger for instantiation options to passthrough to LogDNA's logger client.

Logging to LogDNA Through Bunyan

This module provides an interface that can be hooked into Bunyan and used as a transport to LogDNA. Since @logdna/logger is also an EventEmitter, please make use of the reemitErrorEvents provided by Bunyan so that the implementor can be aware of errors in the LogDNA client. Not doing so will cause Bunyan to throw if @logdna/logger emits an 'error'.

const {createLogger} = require('bunyan')
const LogDNAStream = require('logdna-bunyan')

const logDNA = new LogDNAStream({
  key: apikey
}) // See @logdna/logger for more constructor options

const logger = createLogger({
  name: "My Application"
, streams: [
    {
      stream: process.stdout
    }
  , {
      stream: logDNA
    , type: 'raw'
    , reemitErrorEvents: true // Bubble up 'error' events from @logdna/logger
    }
  ]
})

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

NOTE: You must use the raw stream type, and also reemitErrorEvents must be true. Otherwise, errors emitted by @logdna/logger will throw Bunyan.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Muaz Siddiqui

💻 📖

Samir Musali

💻 📖

Darin Spivey

💻 📖 🔧

vilyapilya

💻 🔧

s100

💻

Bartek R.

💻

Mike Del Tito

💻 🔧

This project follows the all-contributors specification. Contributions of any kind welcome!

License

Copyright © LogDNA, released under an MIT license. See the LICENSE file and https://opensource.org/licenses/MIT

Happy Logging!

changelog

Changelog

2.0.3 (2021-02-22)

Build System

  • replace npmignore with explicit files list f8d35f7 - Mike Del Tito

Chores

Continuous Integration

  • add semantic-release a141f9f - Mike Del Tito

Miscellaneous

  • add @darinspivey as a contributor cd26fe2 - Mike Del Tito
  • add @mdeltito as a contributor 7d09953 - Mike Del Tito
  • add @racbart as a contributor 4bb9da0 - Mike Del Tito
  • add @respectus as a contributor 578e116 - Mike Del Tito
  • add @s100 as a contributor 4cddc7f - Mike Del Tito
  • add @smusali as a contributor a9a65a3 - Mike Del Tito
  • add @vilyapilya as a contributor 8cf3761 - Mike Del Tito

2020-10-28, Version 2.0.2 (Stable)

2020-10-27, Version 2.0.1 (Stable)

2020-10-13, Version 2.0.0 (Stable)