Skip to content

lumigo-io/lumigo-node-log-shipper

Repository files navigation

lumigo-node-log-shipper

@lumigo/lumigo-log-shipper is Lumigo's log shipper for Node.js.

Usage

Install @lumigo/lumigo-log-shipper:

npm:

$ npm i @lumigo/lumigo-log-shipper

In your lambda's code:

const LumigoLogger = require("@lumigo/lumigo-log-shipper");

module.exports.<HANDLER_NAME> = (event, context, callback) => {
  LumigoLogger.shipLogs(event); 
};

With programtic error:

const LumigoLogger = require("@lumigo/lumigo-log-shipper");

module.exports.<HANDLER_NAME> = (event, context, callback) => {
  LumigoLogger.shipLogs(event, "[Error]"); 
};

Add to your lambda's serverless.yml

    - Effect: Allow
      Action:
        - "sts:AssumeRole"
      Resource:
        - "*"