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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sasai-common-utils",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "Reusable utility library for common logging and other shared features.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -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
- return JSON.stringify(info, null, 4);
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
- ecsStringify()
40
+
31
41
  );
32
42
 
33
43
  let silentLogs = false;