1.0.1 • Published 4 years ago

winston-istrace v1.0.1

Weekly downloads
7
License
MIT
Repository
github
Last release
4 years ago

winston-istrace

npm version npm dependencies

npm i -S winston-istrace

Configuration

You need to pass host and service's name, the others params are optional. Others params will be global informations.

  • level param : this param from winston allow you to send only level of logs : by default, it send only error, warn and info logs.
{
  "host": "http://requestb.in/1bx09nv1",
  "service": "my service name",
  "level": "debug",
  "message": "my generic message",
  "action": "my global action",
  "scope": "my global scope",
  "details": "if you have some globals objects"
}

Example

const logger = require('winston');
const IsTraceLogger = require('winston-istrace');

logger.configure({
  transports: [
    new IsTraceLogger({
      host: "http://requestb.in/1bx09nv1",
      service: "my service name"
    })
  ]
});

logger.debug("Stream initialized");

logger.info("Create new stream", {
  details: {
    name: "MyStream",
    timestamp: new Date()
  }
});

logger.warn("Stream in batch", {
  code: 400
});

logger.error("Error to get main stream", {
  code: 300,
  action: "getMainStream",
  scope: "StreamRepository"
});
1.0.1

4 years ago

1.0.0

5 years ago

0.1.1

7 years ago

0.1.0

7 years ago