Skip to content

Commit

Permalink
README improvements (#9)
Browse files Browse the repository at this point in the history
- remove Schibsted from the header
- show how to use it with bunyan
- mention Bunyan and Pino in the package.json
- add more NPM keywords
  • Loading branch information
domeq authored Oct 29, 2020
1 parent 4820451 commit b30dbf9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -34,14 +34,16 @@ 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,
body: JSON.stringify({ foo: 'bar' }),
}));

handler
.use(accessLog());
.use(accessLog({ logger }));
```


Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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 .",
Expand Down Expand Up @@ -35,7 +35,10 @@
"AWS Lambda",
"Middy",
"Access log",
"Logging"
"Logging",
"bunyan",
"pino",
"JSON logger"
],
"author": "",
"license": "GPL-3.0-or-later",
Expand Down

0 comments on commit b30dbf9

Please sign in to comment.