@lark-apaas/nestjs-logger 0.1.0-alpha.13 → 0.1.0-alpha.14
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/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14853,7 +14853,7 @@ var LoggingInterceptor = class {
|
|
|
14853
14853
|
if (this.config.logRequestBody && Object.keys(req.query || {}).length > 0) {
|
|
14854
14854
|
requestMeta["query_params"] = this.sanitizeAndTruncate(req.query);
|
|
14855
14855
|
}
|
|
14856
|
-
this.appLogger.log("HTTP request started \n url=%s \n request_query=%o \n request_body=%o", req.url, requestMeta["query_params"], requestMeta["request_body"]);
|
|
14856
|
+
this.appLogger.log("HTTP request started \n url=%s \n request_query=%o \n request_body=%o", req.url, requestMeta["query_params"] ?? {}, requestMeta["request_body"] ?? {});
|
|
14857
14857
|
this.traceLogger.logStructured("verbose", "HTTP request started", requestMeta, "HTTPTraceInterceptor");
|
|
14858
14858
|
return next.handle().pipe((0, import_operators.tap)((responseData) => {
|
|
14859
14859
|
const durationMs = Date.now() - startedAt;
|
|
@@ -14868,7 +14868,7 @@ var LoggingInterceptor = class {
|
|
|
14868
14868
|
responseMeta["response_body"] = this.sanitizeAndTruncate(responseData);
|
|
14869
14869
|
}
|
|
14870
14870
|
const traceLevel = res.statusCode >= 400 ? "error" : "verbose";
|
|
14871
|
-
appLog("HTTP request completed\n url=%s \n status_code=%d \n duration_ms=%d \nresponse_body=%o", req.url, statusCode, durationMs, responseMeta.response_body);
|
|
14871
|
+
appLog("HTTP request completed\n url=%s \n status_code=%d \n duration_ms=%d \nresponse_body=%o", req.url, statusCode, durationMs, responseMeta.response_body ?? {});
|
|
14872
14872
|
this.traceLogger.logStructured(traceLevel, "HTTP request completed", responseMeta, "HTTPTraceInterceptor");
|
|
14873
14873
|
}), (0, import_operators.catchError)((error) => {
|
|
14874
14874
|
const durationMs = Date.now() - startedAt;
|