sasai-common-utils 1.0.22 → 1.0.24
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/package.json +1 -1
- package/src/features/logger/index.js +12 -2
package/package.json
CHANGED
|
@@ -17,6 +17,7 @@ const logFormat = winston.format.combine(
|
|
|
17
17
|
winston.format((info) => redactInformation(info))(), // Redact sensitive data
|
|
18
18
|
winston.format.errors({ stack: true }),
|
|
19
19
|
winston.format.json(),
|
|
20
|
+
ecsStringify(),
|
|
20
21
|
winston.format.printf((info) => {
|
|
21
22
|
const traceContext = contextProvider();
|
|
22
23
|
info.time = info.timestamp;
|
|
@@ -25,9 +26,18 @@ const logFormat = winston.format.combine(
|
|
|
25
26
|
delete info.level;
|
|
26
27
|
info.trace = traceContext?.traceId|| "";
|
|
27
28
|
info.span = traceContext?.spanId|| "";
|
|
28
|
-
|
|
29
|
+
const orderedLog = {
|
|
30
|
+
app: info.app ,
|
|
31
|
+
trace: info.trace,
|
|
32
|
+
span: info.span,
|
|
33
|
+
time: info.time,
|
|
34
|
+
LEVEL: info.LEVEL,
|
|
35
|
+
class: info.class,
|
|
36
|
+
message: info.message
|
|
37
|
+
}
|
|
38
|
+
return JSON.stringify(orderedLog, null, 0);
|
|
29
39
|
}),
|
|
30
|
-
|
|
40
|
+
|
|
31
41
|
);
|
|
32
42
|
|
|
33
43
|
let silentLogs = false;
|