Nihilist Pocket Monsters

    winston-istrace

    1.0.1 • Public • Published

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

    Install

    npm i winston-istrace

    DownloadsWeekly Downloads

    4

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    7.06 kB

    Total Files

    6

    Last publish

    Collaborators

    • toinane