aws-lambda-logger

1.2.0 • Public • Published

AWS Lambda Logger

When you create your a AWS Lambda you need to have a good logger to view this logs in CloudWatch. This package has a debug and error logger.

Installation

npm install --save aws-lambda-logger

Example

  const logger = require('aws-lambda-logger');
 
  exports.handler = (event, context, callback) => {
    // logger [debug] method needs at least 2 parameters
    // context and data (custom data to log)
    logger.debug(context, {'data': 'Example'});
 
    // logger [error] method needs at least 2 parameters
    // context and error (error to trace)
    logger.error(context, error);
    
    callback(null, true;
  };

Package Sidebar

Install

npm i aws-lambda-logger

Weekly Downloads

2

Version

1.2.0

License

Apache-2.0

Unpacked Size

13.6 kB

Total Files

4

Last publish

Collaborators

  • alexmeji