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
npm install @mgcrea/fastify-request-logger
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
20 Stars
81 Commits
2 Forks
2 Watching
2 Branches
1 Contributors
Updated on 17 Nov 2024
TypeScript (89.74%)
JavaScript (10.26%)
Cumulative downloads
Total Downloads
Last day
-52.2%
97
Compared to previous day
Last week
-11.4%
984
Compared to previous week
Last month
17.8%
4,361
Compared to previous month
Last year
-15.7%
37,870
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
4 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3
Reason
8 existing vulnerabilities detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
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
security policy file not detected
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2024-11-18
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