Comparing version 10.0.0 to 11.0.0
@@ -124,2 +124,15 @@ ## [9.0.0](https://www.github.com/restify/node-restify/compare/v8.6.1...v9.0.0) (2022-11-15) | ||
## [11.0.0](https://github.com/restify/node-restify/compare/v10.0.0...v11.0.0) (2023-01-17) | ||
### ⚠ BREAKING CHANGES | ||
* don't override req.log if set during .first | ||
* use req.log on audit plugin | ||
### Features | ||
* don't override req.log if set during .first ([852d2c1](https://github.com/restify/node-restify/commit/852d2c153d1815274db8cdd7799625e9740090b3)) | ||
* use req.log on audit plugin ([528ecbc](https://github.com/restify/node-restify/commit/528ecbcec5d70c458749bdd4c4cc3f9e06ab69a2)) | ||
## [10.0.0](https://github.com/restify/node-restify/compare/v9.0.0...v10.0.0) (2022-11-29) | ||
@@ -126,0 +139,0 @@ |
@@ -263,12 +263,2 @@ // Copyright 2012 Mark Cavage, Inc. All rights reserved. | ||
var log = opts.log.child( | ||
{ | ||
audit: true, | ||
component: opts.event | ||
}, | ||
{ | ||
serializers: serializers | ||
} | ||
); | ||
function audit(req, res, route, err) { | ||
@@ -299,3 +289,13 @@ var latency = res.get('Response-Time'); | ||
if (printLog) { | ||
const origLog = (req && req.log) || opts.log; | ||
if (printLog && origLog) { | ||
const log = origLog.child( | ||
{ | ||
audit: true, | ||
component: opts.event | ||
}, | ||
{ | ||
serializers: serializers | ||
} | ||
); | ||
switch (opts.event) { | ||
@@ -302,0 +302,0 @@ case 'after': |
@@ -1297,3 +1297,9 @@ // Copyright 2012 Mark Cavage, Inc. All rights reserved. | ||
req._dtraceId = dtrace.nextId(); | ||
req.log = res.log = self.log; | ||
// if log is set on .first, don't override it | ||
if (req.log === undefined) { | ||
req.log = self.log; | ||
} | ||
if (res.log === undefined) { | ||
res.log = req.log; | ||
} | ||
req._date = new Date(); | ||
@@ -1300,0 +1306,0 @@ req._timeStart = process.hrtime(); |
@@ -77,3 +77,3 @@ { | ||
], | ||
"version": "10.0.0", | ||
"version": "11.0.0", | ||
"repository": { | ||
@@ -80,0 +80,0 @@ "type": "git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
350144
8088