@jaypie/express 1.2.27 → 1.2.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +12 -4
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +12 -4
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -2065,14 +2065,18 @@ function expressHandler(handlerOrOptions, optionsOrHandler) {
|
|
|
2065
2065
|
const contentLengthHeader = headers["content-length"];
|
|
2066
2066
|
const contentLength = contentLengthHeader ? Number(contentLengthHeader) : 0;
|
|
2067
2067
|
// Add request data to session report
|
|
2068
|
-
|
|
2068
|
+
const reportData = {
|
|
2069
2069
|
method: req.method,
|
|
2070
2070
|
path,
|
|
2071
2071
|
query,
|
|
2072
2072
|
contentType,
|
|
2073
2073
|
contentLength,
|
|
2074
2074
|
status: String(res.statusCode),
|
|
2075
|
-
}
|
|
2075
|
+
};
|
|
2076
|
+
if (req.params && Object.keys(req.params).length > 0) {
|
|
2077
|
+
reportData.parameters = { ...req.params };
|
|
2078
|
+
}
|
|
2079
|
+
logger$1.report(reportData);
|
|
2076
2080
|
// Submit metric if Datadog is configured
|
|
2077
2081
|
if (hasDatadogEnv()) {
|
|
2078
2082
|
let metricPrefix = "project";
|
|
@@ -2353,11 +2357,15 @@ function expressStreamHandler(handlerOrOptions, optionsOrHandler) {
|
|
|
2353
2357
|
}
|
|
2354
2358
|
path = path.replace(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi, ":id");
|
|
2355
2359
|
// Add request data to session report
|
|
2356
|
-
|
|
2360
|
+
const reportData = {
|
|
2357
2361
|
method: req.method,
|
|
2358
2362
|
path,
|
|
2359
2363
|
status: String(res.statusCode),
|
|
2360
|
-
}
|
|
2364
|
+
};
|
|
2365
|
+
if (req.params && Object.keys(req.params).length > 0) {
|
|
2366
|
+
reportData.parameters = { ...req.params };
|
|
2367
|
+
}
|
|
2368
|
+
logger.report(reportData);
|
|
2361
2369
|
// Submit metric if Datadog is configured
|
|
2362
2370
|
if (hasDatadogEnv()) {
|
|
2363
2371
|
let metricPrefix = "project";
|