@lark-apaas/nestjs-logger 0.1.0-alpha.12 → 0.1.0-alpha.13
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 +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -14869,7 +14869,7 @@ var LoggingInterceptor = class {
|
|
|
14869
14869
|
return next.handle().pipe((0, import_operators.tap)((responseData) => {
|
|
14870
14870
|
const durationMs = Date.now() - startedAt;
|
|
14871
14871
|
const statusCode = res.statusCode;
|
|
14872
|
-
const appLog = res.statusCode >= 400 ?
|
|
14872
|
+
const appLog = this.appLogger[res.statusCode >= 400 ? "error" : "log"].bind(this.appLogger);
|
|
14873
14873
|
const responseMeta = {
|
|
14874
14874
|
...baseMeta,
|
|
14875
14875
|
status_code: statusCode,
|
|
@@ -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 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;
|
|
@@ -14905,7 +14905,7 @@ var LoggingInterceptor = class {
|
|
|
14905
14905
|
} else {
|
|
14906
14906
|
meta["error"] = String(error);
|
|
14907
14907
|
}
|
|
14908
|
-
this.appLogger.error("HTTP request failed\n url=%s status_code=%d \n duration_ms=%d \nerror=%o", req.url, statusCode, durationMs, meta.error);
|
|
14908
|
+
this.appLogger.error("HTTP request failed\n url=%s \n status_code=%d \n duration_ms=%d \nerror=%o", req.url, statusCode, durationMs, meta.error);
|
|
14909
14909
|
this.traceLogger.logStructured("error", "HTTP request failed", meta, "HTTPTraceInterceptor");
|
|
14910
14910
|
throw error;
|
|
14911
14911
|
}));
|
|
@@ -15074,7 +15074,7 @@ LoggerModule = _ts_decorate5([
|
|
|
15074
15074
|
useFactory: /* @__PURE__ */ __name((config) => {
|
|
15075
15075
|
return createPinoLogger({
|
|
15076
15076
|
level: config.level,
|
|
15077
|
-
filePath: `${config.logDir}/
|
|
15077
|
+
filePath: `${config.logDir}/server.log`
|
|
15078
15078
|
});
|
|
15079
15079
|
}, "useFactory"),
|
|
15080
15080
|
inject: [
|