aws-lambda-logger
v1.2.0
Published
AWS Lambda Logger for NodeJS
Downloads
6
Maintainers
Readme
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;
};