This package has been deprecated

Author message:

WARNING: This project is not maintained by Coralogix, to use the official Coralogix package, install using coralogix-logger-bunyan

coralogix-bunyan

0.0.11 • Public • Published

This package lets you connect your nodeJS applications to Coralogix's log analytics platform.

Coralogix Bunyan Stream

For more information on how to setup and use bunyan head over to the bunyan repository.

Installation

npm install coralogix-bunyan --save

Usage

var bunyan = require('bunyan');
var CoralogixBunyan = require('coralogix-bunyan');
var hostname = require('os').hostname();
 
var log = bunyan.createLogger({
  name: 'myLogger',
  streams: [
    {
      level: 'debug', // bunyan log level
      stream: new CoralogixBunyan({
        privateKey: '00000000-0000-0000-0000-000000000000', // your private key you received when signing up
        applicationName: 'BunyanApp',
        subsystemName: 'BunyanSub',
        computerName: hostname // optional
      }),
      type: 'raw' // mandatory
    }
  ]
});
 
// simple logging
log.info('A user has signed in');
// logging with parameters
var user = {name: 'JohnD'};
log.info('A user has signed in', {user: user});
// send Coralogix optional data for better learning and querying
log.info({
  class: 'UserManager',
  method: 'HandleSignin',
  category: 'Security',
  IPAddress: '1.1.1.1'
}, 'A user has signed in', {user: user});
 

Readme

Keywords

none

Package Sidebar

Install

npm i coralogix-bunyan

Weekly Downloads

12

Version

0.0.11

License

ISC

Last publish

Collaborators

  • yairhaimo