1.0.100 • Published 7 years ago

micro-logging v1.0.100

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

Logging

Simple logging module for microsystems that wraps winston and continuation-local-storage.

What we ultimately wanted to achieve is to generate microservice logs that are unique, traceable, and contain enough data to act on quickly and effectively. To create these logs: Append a unique identifier to requests as they enter the architecture. Identify the service that generates events. Generate events specific to each microservice as the request enters and leaves the service. Correlate events from each microservice to create an overall view of the request.

Install

 npm install micro-logging

Usage

  var log = require('micro-logging');

  log.info('hello world');

  log.debug('hello world', 'Meta Data')

Features

  • Timestamp
  • API Name - Set as serverName in Config
  • Log Level - Set as logLevel in Config
  • Correlation id - Set as correlationid in context
  • Client Application - Set as clientapplication in context
  • Global User Id - Set as globaluserid in context
  • Message
  • Meta data

Set Context in calling application

var session = require('continuation-local-storage').createNamespace('request'); session.set('correlationid', req.headers.correlationid); session.set('clientapplication', req.headers.clientapplication); session.set('globaluserid', req.headers.globaluserid);

Set Config

serverName=Api Name logLevel=info, error, debug etc...

External Dependencies

  • Node
  • Config
1.0.100

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.0

7 years ago