@mgcrea/fastify-request-logger
Advanced tools
Comparing version 0.6.1 to 0.7.0
@@ -1,2 +0,2 @@ | ||
The MIT License | ||
# The MIT License | ||
@@ -3,0 +3,0 @@ Copyright (c) 2020 Olivier Louvignes <olivier@mgcrea.io> |
{ | ||
"name": "@mgcrea/fastify-request-logger", | ||
"version": "0.6.1", | ||
"version": "0.7.0", | ||
"description": "Compact request logger plugin for fastify written in TypeScript", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"author": "Olivier Louvignes <olivier@mgcrea.io>", | ||
@@ -11,9 +9,26 @@ "repository": "github:mgcrea/fastify-request-logger", | ||
"access": "public", | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"require": "./dist/index.cjs", | ||
"import": "./dist/index.js", | ||
"types": "./dist/index.d.ts" | ||
} | ||
}, | ||
"main": "./dist/index.cjs", | ||
"module": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"build": "rm -rf lib/*; tsc --build", | ||
"test": "jest", | ||
"start": "npm run spec -- --watch", | ||
"build": "rimraf dist/*; tsc --project tsconfig.build.json && tsup src/index.ts --format cjs", | ||
"lint": "eslint src/ test/", | ||
"prettycheck": "prettier --check src/ test/", | ||
"prettyfix": "prettier --write src/ test/", | ||
"typecheck": "tsc --noEmit", | ||
"prettycheck": "prettier --check 'src/' --check 'test/'", | ||
"lint": "eslint src/ test/", | ||
"prepare": "npm run build" | ||
"spec": "DEBUG=fastify-session*,prisma-query jest --runInBand", | ||
"test": "npm run lint && npm run prettycheck && npm run typecheck && npm run spec", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
@@ -26,24 +41,25 @@ "keywords": [ | ||
"devDependencies": { | ||
"@tsconfig/node10": "^1.0.9", | ||
"@types/ioredis": "^4.28.10", | ||
"@types/jest": "^28.1.1", | ||
"@types/node": "^17.0.44", | ||
"@types/pino": "^7.0.4", | ||
"@typescript-eslint/eslint-plugin": "^5.28.0", | ||
"@typescript-eslint/parser": "^5.28.0", | ||
"eslint": "^8.17.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-jest": "^26.5.3", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"fastify": "^4.0.3", | ||
"jest": "^28.1.1", | ||
"pino-pretty": "^8.0.0", | ||
"prettier": "^2.7.0", | ||
"ts-jest": "^28.0.5", | ||
"typescript": "^4.7.3" | ||
"@tsconfig/node-lts-strictest-esm": "^18.12.1", | ||
"@types/jest": "^29.2.5", | ||
"@types/node": "^18.11.18", | ||
"@typescript-eslint/eslint-plugin": "^5.48.1", | ||
"@typescript-eslint/parser": "^5.48.1", | ||
"eslint": "^8.31.0", | ||
"eslint-config-prettier": "^8.6.0", | ||
"eslint-plugin-jest": "^27.2.1", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"fastify": "^4.11.0", | ||
"jest": "^29.3.1", | ||
"pino": "^8.8.0", | ||
"pino-pretty": "^9.1.1", | ||
"prettier": "^2.8.2", | ||
"rimraf": "^3.0.2", | ||
"ts-jest": "^29.0.3", | ||
"tsup": "^6.5.0", | ||
"typescript": "^4.9.4" | ||
}, | ||
"dependencies": { | ||
"chalk": "^4.1.1", | ||
"fastify-plugin": "^3.0.1" | ||
"chalk": "^4", | ||
"fastify-plugin": "^4.4.0" | ||
} | ||
} |
@@ -5,5 +5,4 @@ # FastifyRequestLogger | ||
[![license](https://img.shields.io/npm/l/@mgcrea/fastify-request-logger)](https://tldrlegal.com/license/mit-license) | ||
[![build status](https://img.shields.io/github/workflow/status/mgcrea/fastify-request-logger/ci)](https://github.com/mgcrea/fastify-request-logger/actions) | ||
[![dependencies status](https://img.shields.io/david/mgcrea/fastify-request-logger)](https://david-dm.org/mgcrea/fastify-request-logger) | ||
[![devDependencies status](https://img.shields.io/david/dev/mgcrea/fastify-request-logger)](https://david-dm.org/mgcrea/fastify-request-logger?type=dev) | ||
[![build status](https://img.shields.io/github/actions/workflow/status/mgcrea/fastify-request-logger/main.yml?branch=master)](https://github.com/mgcrea/fastify-request-logger/actions) | ||
[![dependencies status](https://img.shields.io/depfu/dependencies/github/mgcrea/fastify-request-logger)](https://depfu.com/github/mgcrea/fastify-request-logger) | ||
@@ -30,3 +29,3 @@ Compact request logger plugin for [fastify](https://github.com/fastify/fastify). | ||
# or | ||
yarn add @mgcrea/fastify-request-logger @mgcrea/pino-pretty-compact | ||
pnpm add @mgcrea/fastify-request-logger @mgcrea/pino-pretty-compact | ||
``` | ||
@@ -43,3 +42,9 @@ | ||
const fastify = createFastify({ | ||
logger: { prettyPrint: true, prettifier }, | ||
logger: { | ||
level: 'debug', | ||
transport: { | ||
target: '@mgcrea/pino-pretty-compact', | ||
options: { translateTime: 'HH:MM:ss Z', ignore: 'pid,hostname' }, | ||
}, | ||
}, | ||
disableRequestLogging: true, | ||
@@ -55,2 +60,14 @@ ...options, | ||
### Options | ||
```ts | ||
type FastifyRequestLoggerOptions = { | ||
logBody?: boolean; | ||
logBindings?: Record<string, unknown>; | ||
ignoredPaths?: Array<string | RegExp>; | ||
ignoredBindings?: Record<string, unknown>; | ||
ignore?: (request: FastifyRequest) => boolean; | ||
}; | ||
``` | ||
## Authors | ||
@@ -57,0 +74,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
13034
8
163
98
Yes
18
1
+ Addedfastify-plugin@4.5.1(transitive)
- Removedfastify-plugin@3.0.1(transitive)
Updatedchalk@^4
Updatedfastify-plugin@^4.4.0