unnbound-logger-sdk 2.0.1 → 2.0.2
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/unnbound-logger.js +5 -5
- package/package.json +1 -1
package/dist/unnbound-logger.js
CHANGED
|
@@ -69,7 +69,7 @@ class UnnboundLogger {
|
|
|
69
69
|
url: `${config.baseURL || ''}${config.url}`,
|
|
70
70
|
originalUrl: `${config.baseURL || ''}${config.url}`,
|
|
71
71
|
headers: config.headers || {},
|
|
72
|
-
body: config.data,
|
|
72
|
+
body: (0, logger_utils_1.safeJsonParse)(config.data),
|
|
73
73
|
ip: 'outgoing', // Mark as outgoing request
|
|
74
74
|
protocol: 'https', // Default for outgoing
|
|
75
75
|
secure: true,
|
|
@@ -106,7 +106,7 @@ class UnnboundLogger {
|
|
|
106
106
|
const mockRes = {
|
|
107
107
|
statusCode: response.status,
|
|
108
108
|
locals: {
|
|
109
|
-
body: response.data,
|
|
109
|
+
body: (0, logger_utils_1.safeJsonParse)(response.data),
|
|
110
110
|
startTime: startTime,
|
|
111
111
|
traceId: trace_context_1.traceContext.getTraceId(),
|
|
112
112
|
requestId: requestId
|
|
@@ -139,7 +139,7 @@ class UnnboundLogger {
|
|
|
139
139
|
const mockRes = {
|
|
140
140
|
statusCode: error.response.status,
|
|
141
141
|
locals: {
|
|
142
|
-
body: error.response.data,
|
|
142
|
+
body: (0, logger_utils_1.safeJsonParse)(error.response.data),
|
|
143
143
|
startTime: startTime,
|
|
144
144
|
traceId: trace_context_1.traceContext.getTraceId(),
|
|
145
145
|
requestId: requestId
|
|
@@ -340,7 +340,7 @@ class UnnboundLogger {
|
|
|
340
340
|
method: req.method,
|
|
341
341
|
headers: (0, logger_utils_1.filterHeaders)(req.headers),
|
|
342
342
|
ip: (0, logger_utils_1.normalizeIp)(req.ip),
|
|
343
|
-
body: req.body,
|
|
343
|
+
body: (0, logger_utils_1.safeJsonParse)(req.body),
|
|
344
344
|
},
|
|
345
345
|
};
|
|
346
346
|
this.logger[options.level || this.defaultLevel](logEntry);
|
|
@@ -383,7 +383,7 @@ class UnnboundLogger {
|
|
|
383
383
|
headers: (0, logger_utils_1.filterHeaders)(res.getHeaders()),
|
|
384
384
|
ip: (0, logger_utils_1.normalizeIp)(req.ip),
|
|
385
385
|
status: res.statusCode,
|
|
386
|
-
body: res.locals.body,
|
|
386
|
+
body: (0, logger_utils_1.safeJsonParse)(res.locals.body),
|
|
387
387
|
},
|
|
388
388
|
};
|
|
389
389
|
this.logger[level](logEntry);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unnbound-logger-sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "A structured logging library with TypeScript support using Pino. Provides consistent, well-typed logging across different operational contexts with automatic trace ID propagation.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|