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

coralogix-winston

1.1.0 • Public • Published

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

Coralogix Winston Transport

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

Installation

npm install coralogix-winston --save

Usage

var winston = require('winston');
var CoralogixWinston = require('coralogix-winston');
var hostname = require('os').hostname();
 
 
var winstonLogger = new (winston.Logger)({
  transports: [
    new (CoralogixWinston)({
      privateKey: '00000000-0000-0000-0000-000000000000', // your private key you received when signing up
      applicationName: 'ACME Website',
      subsystemName: 'WebAPI',
      computerName: hostname, // optional
      level: 'debug' // winston log level
    })
  ]
});
 
// use winston regularly
winstonLogger.debug('This is a debug message');
// send Coralogix optional data for better learning and querying.
// these reserved word parameters will not be part of the message text.
winstonLogger.debug('A user has signed in', {
  'class': 'UserManager',
  'method': 'HandleSignin',
  'category': 'Security',
  'IPAddress': '1.1.1.1',
  'threadId': '123-a'
});

Keywords

none

install

npm i coralogix-winston

Downloadsweekly downloads

340

version

1.1.0

license

ISC

last publish

collaborators

  • avatar
Report a vulnerability