Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pino-http

Package Overview
Dependencies
Maintainers
4
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pino-http - npm Package Compare versions

Comparing version 5.3.0 to 5.4.0

2

logger.js

@@ -97,3 +97,3 @@ 'use strict'

if (reqCustomProps) {
var customPropBindings = (typeof reqCustomProps === 'function') ? reqCustomProps(req) : reqCustomProps
var customPropBindings = (typeof reqCustomProps === 'function') ? reqCustomProps(req, res) : reqCustomProps
log = log.child(customPropBindings)

@@ -100,0 +100,0 @@ }

{
"name": "pino-http",
"version": "5.3.0",
"version": "5.4.0",
"description": "High-speed HTTP logger for Node.js",

@@ -21,5 +21,6 @@ "main": "logger.js",

"scripts": {
"benchmark": "./scripts/benchmark-all",
"benchmark": "bash ./scripts/benchmark-all",
"test": "standard && tap --no-cov test.js",
"ci": "standard && tap --cov test.js"
"ci": "standard && tap --cov test.js",
"fix": "standard --fix"
},

@@ -26,0 +27,0 @@ "author": "David Mark Clements",

@@ -108,3 +108,3 @@ # pino-http  [![Build Status](https://img.shields.io/github/workflow/status/pinojs/pino-http/CI)](https://github.com/pinojs/pino-http/actions)

* `wrapSerializers`: when `false`, custom serializers will be passed the raw value directly. Defaults to `true`.
* `reqCustomProps`: set to a `function (req) => { /* returns on object */ }` or `{ /* returns on object */ }` This function will be invoked for each request with `req` where we could pass additional properties that needs to be logged outside the `req`.
* `reqCustomProps`: set to a `function (req,res) => { /* returns on object */ }` or `{ /* returns on object */ }` This function will be invoked for each request with `req` and `res` where we could pass additional properties that needs to be logged outside the `req`.
`stream`: the destination stream. Could be passed in as an option too.

@@ -173,5 +173,7 @@

// Define additional custom request properties
reqCustomProps: function (req) {
reqCustomProps: function (req,res) {
return {
customProp: req.customProp
customProp: req.customProp,
// user request-scoped data is in res.locals for express applications
customProp2: res.locals.myCustomData
}

@@ -178,0 +180,0 @@ }

@@ -764,4 +764,4 @@ 'use strict'

var dest = split(JSON.parse)
function customPropsHandler (req) {
if (req) {
function customPropsHandler (req, res) {
if (req && res) {
return {

@@ -768,0 +768,0 @@ key1: 'value1',

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc