From b30dbf95d4ed1af41620746f29ca943a04876de9 Mon Sep 17 00:00:00 2001 From: Wojciech Iskra Date: Thu, 29 Oct 2020 08:24:05 +0100 Subject: [PATCH] README improvements (#9) - remove Schibsted from the header - show how to use it with bunyan - mention Bunyan and Pino in the package.json - add more NPM keywords --- README.md | 6 ++++-- package.json | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9355e276..684b817e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Schibsted Middy access log middleware +# Middy access log middleware #### Access log middleware for the middy framework, the stylish Node.js middleware engine for AWS Lambda @@ -34,6 +34,8 @@ See the sample usage below. ```javascript const middy = require('@middy/core'); const accessLog = require('@schibsted/middy-access-log'); +const bunyan = require('bunyan'); +const logger = bunyan.createLogger({name: "myapp"}); const handler = middy(async () => ({ statusCode: 200, @@ -41,7 +43,7 @@ const handler = middy(async () => ({ })); handler - .use(accessLog()); + .use(accessLog({ logger })); ``` diff --git a/package.json b/package.json index ec9c408d..536b256f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@schibsted/middy-access-log", "version": "0.1.0", - "description": "Middy middleware for logging processed requests in an access-log like fashion", + "description": "Middy middleware for logging processed requests in an access-log like fashion. Optimised for JSON loggers e.g. Bunyan or Pino.", "main": "index.js", "scripts": { "lint": "eslint .", @@ -35,7 +35,10 @@ "AWS Lambda", "Middy", "Access log", - "Logging" + "Logging", + "bunyan", + "pino", + "JSON logger" ], "author": "", "license": "GPL-3.0-or-later",