@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.
@@ -2067,14 +2067,18 @@ function expressHandler(handlerOrOptions, optionsOrHandler) {
2067
2067
  const contentLengthHeader = headers["content-length"];
2068
2068
  const contentLength = contentLengthHeader ? Number(contentLengthHeader) : 0;
2069
2069
  // Add request data to session report
2070
- logger$1.report({
2070
+ const reportData = {
2071
2071
  method: req.method,
2072
2072
  path,
2073
2073
  query,
2074
2074
  contentType,
2075
2075
  contentLength,
2076
2076
  status: String(res.statusCode),
2077
- });
2077
+ };
2078
+ if (req.params && Object.keys(req.params).length > 0) {
2079
+ reportData.parameters = { ...req.params };
2080
+ }
2081
+ logger$1.report(reportData);
2078
2082
  // Submit metric if Datadog is configured
2079
2083
  if (datadog.hasDatadogEnv()) {
2080
2084
  let metricPrefix = "project";
@@ -2355,11 +2359,15 @@ function expressStreamHandler(handlerOrOptions, optionsOrHandler) {
2355
2359
  }
2356
2360
  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");
2357
2361
  // Add request data to session report
2358
- logger.report({
2362
+ const reportData = {
2359
2363
  method: req.method,
2360
2364
  path,
2361
2365
  status: String(res.statusCode),
2362
- });
2366
+ };
2367
+ if (req.params && Object.keys(req.params).length > 0) {
2368
+ reportData.parameters = { ...req.params };
2369
+ }
2370
+ logger.report(reportData);
2363
2371
  // Submit metric if Datadog is configured
2364
2372
  if (datadog.hasDatadogEnv()) {
2365
2373
  let metricPrefix = "project";