Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

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});
 

Keywords

none

install

npm i coralogix-bunyan

Downloadsweekly downloads

119

version

0.0.11

license

ISC

last publish

collaborators

  • avatar
Report a vulnerability