Skip to content

Middy midleware for logging requests, responses as well as errors.

License

Notifications You must be signed in to change notification settings

jsperezg/middy-awesome-logs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

middy-awesome-logs

npm (scoped) npm bundle size (minified)

Description

This package provides a middy Middleware that logs requests and responses. It is based on @middy/input-out-logger middleware.

Why

@middy/input-out-logger is great but since it requires @middy/core I decided to create something that was useful for all those that still work with middy.

Install

$ npm install middy-awesome-logs

Options

logger property accept a function (default console.log).

Usage

const middy = require('middy');
const awesomeLogs = require('middy-awesome-logs');
 
const handler = middy((event, context, cb) => {
  const response = {
    statusCode: 200,
    headers: {},
    body: JSON.stringify({ message: 'hello world' })
  };
 
  callback(null, response)
});
 
handler.use(awesomeLogs());

About

Middy midleware for logging requests, responses as well as errors.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published