Gathering detailed insights and metrics for @mgcrea/fastify-request-logger
Gathering detailed insights and metrics for @mgcrea/fastify-request-logger
Gathering detailed insights and metrics for @mgcrea/fastify-request-logger
Gathering detailed insights and metrics for @mgcrea/fastify-request-logger
Compact request logger plugin for fastify
npm install @mgcrea/fastify-request-logger
Typescript
Module System
Node Version
NPM Version
73.8
Supply Chain
99.5
Quality
79.7
Maintenance
100
Vulnerability
100
License
TypeScript (89.98%)
JavaScript (10.02%)
Total Downloads
122,671
Last Day
52
Last Week
1,133
Last Month
4,043
Last Year
45,460
MIT License
20 Stars
84 Commits
2 Forks
2 Watchers
2 Branches
1 Contributors
Updated on Feb 02, 2025
Minified
Minified + Gzipped
Latest Version
1.9.1
Package Id
@mgcrea/fastify-request-logger@1.9.1
Unpacked Size
30.86 kB
Size
6.06 kB
File Count
9
NPM Version
10.9.0
Node Version
22.12.0
Published on
Feb 02, 2025
Cumulative downloads
Total Downloads
Last Day
-3.7%
52
Compared to previous day
Last Week
17.7%
1,133
Compared to previous week
Last Month
-15.8%
4,043
Compared to previous month
Last Year
-5.7%
45,460
Compared to previous year
Compact request logger plugin for fastify.
Relies on kolorist for the coloring.
Usually used along @mgcrea/pino-pretty-compact to prettify logs.
Built with TypeScript for static type checking with exported types along the library.
1npm install @mgcrea/fastify-request-logger @mgcrea/pino-pretty-compact --save 2# or 3pnpm add @mgcrea/fastify-request-logger @mgcrea/pino-pretty-compact
You probably want to disable fastify own request logging using the disableRequestLogging
option.
1import createFastify, { FastifyInstance, FastifyServerOptions } from "fastify"; 2import fastifyRequestLogger from "@mgcrea/fastify-request-logger"; 3import prettifier from "@mgcrea/pino-pretty-compact"; 4 5export const buildFastify = (options: FastifyServerOptions = {}): FastifyInstance => { 6 const fastify = createFastify({ 7 logger: { 8 level: "debug", 9 transport: { 10 target: "@mgcrea/pino-pretty-compact", 11 options: { translateTime: "HH:MM:ss Z", ignore: "pid,hostname" }, 12 }, 13 }, 14 disableRequestLogging: true, 15 ...options, 16 }); 17 18 fastify.register(fastifyRequestLogger); 19 20 return fastify; 21};
1type FastifyRequestLoggerOptions = { 2 logBody?: boolean; 3 logBindings?: Record<string, unknown>; 4 ignoredPaths?: Array<string | RegExp>; 5 ignoredBindings?: Record<string, unknown>; 6 ignore?: (request: FastifyRequest) => boolean; 7};
1The MIT License 2 3Copyright (c) 2020 Olivier Louvignes <olivier@mgcrea.io> 4 5Permission is hereby granted, free of charge, to any person obtaining a copy 6of this software and associated documentation files (the "Software"), to deal 7in the Software without restriction, including without limitation the rights 8to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9copies of the Software, and to permit persons to whom the Software is 10furnished to do so, subject to the following conditions: 11 12The above copyright notice and this permission notice shall be included in 13all copies or substantial portions of the Software. 14 15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21THE SOFTWARE.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
20 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More