@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.cjs
CHANGED
|
@@ -14864,7 +14864,7 @@ var LoggingInterceptor = class {
|
|
|
14864
14864
|
if (this.config.logRequestBody && Object.keys(req.query || {}).length > 0) {
|
|
14865
14865
|
requestMeta["query_params"] = this.sanitizeAndTruncate(req.query);
|
|
14866
14866
|
}
|
|
14867
|
-
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"]);
|
|
14867
|
+
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"] ?? {});
|
|
14868
14868
|
this.traceLogger.logStructured("verbose", "HTTP request started", requestMeta, "HTTPTraceInterceptor");
|
|
14869
14869
|
return next.handle().pipe((0, import_operators.tap)((responseData) => {
|
|
14870
14870
|
const durationMs = Date.now() - startedAt;
|
|
@@ -14879,7 +14879,7 @@ var LoggingInterceptor = class {
|
|
|
14879
14879
|
responseMeta["response_body"] = this.sanitizeAndTruncate(responseData);
|
|
14880
14880
|
}
|
|
14881
14881
|
const traceLevel = res.statusCode >= 400 ? "error" : "verbose";
|
|
14882
|
-
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);
|
|
14882
|
+
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 ?? {});
|
|
14883
14883
|
this.traceLogger.logStructured(traceLevel, "HTTP request completed", responseMeta, "HTTPTraceInterceptor");
|
|
14884
14884
|
}), (0, import_operators.catchError)((error) => {
|
|
14885
14885
|
const durationMs = Date.now() - startedAt;
|