@xrystal/core 3.5.4 → 3.5.5

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,7 +1,7 @@
1
1
  {
2
2
  "author": "Yusuf Yasir KAYGUSUZ",
3
3
  "name": "@xrystal/core",
4
- "version": "3.5.4",
4
+ "version": "3.5.5",
5
5
  "description": "Project core for xrystal",
6
6
  "publishConfig": {
7
7
  "access": "public",
@@ -29,15 +29,15 @@ export default class LoggerService {
29
29
  getTracingFormat = format((info) => {
30
30
  const store = LoggerService.storage.getStore();
31
31
  if (store) {
32
- info.correlationId = store.get("correlationId");
32
+ info.id = store.get("correlationId");
33
33
  }
34
34
  return info;
35
35
  });
36
36
  getConsoleFormat() {
37
37
  return format.combine(this.getTracingFormat(), format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }), format.colorize({ all: true }), format.printf((info) => {
38
38
  const msg = typeof info.message === "object" ? JSON.stringify(info.message) : info.message;
39
- const id = info.correlationId ? ` [ID: ${info.correlationId}]` : "";
40
- return `${info.timestamp} [${this.serviceName}]${info.level}: ${msg} : ${id}`;
39
+ const idPart = info.id ? ` : id: ${info.id}` : "";
40
+ return `${info.timestamp} [${this.serviceName}] ${info.level}: ${msg}${idPart}`;
41
41
  }));
42
42
  }
43
43
  winston = winston.createLogger({
@@ -135,9 +135,10 @@ export default class LoggerService {
135
135
  topic: this.kafkaTopic,
136
136
  messages: [{
137
137
  value: JSON.stringify({
138
- ...info,
139
138
  service: this.serviceName,
139
+ id: info.id || null,
140
140
  env: this.environment,
141
+ ...info,
141
142
  timestamp: new Date().toISOString()
142
143
  })
143
144
  }]
@@ -29,15 +29,15 @@ export default class LoggerService {
29
29
  getTracingFormat = format((info) => {
30
30
  const store = LoggerService.storage.getStore();
31
31
  if (store) {
32
- info.correlationId = store.get("correlationId");
32
+ info.id = store.get("correlationId");
33
33
  }
34
34
  return info;
35
35
  });
36
36
  getConsoleFormat() {
37
37
  return format.combine(this.getTracingFormat(), format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }), format.colorize({ all: true }), format.printf((info) => {
38
38
  const msg = typeof info.message === "object" ? JSON.stringify(info.message) : info.message;
39
- const id = info.correlationId ? ` [ID: ${info.correlationId}]` : "";
40
- return `${info.timestamp} [${this.serviceName}]${info.level}: ${msg} : ${id}`;
39
+ const idPart = info.id ? ` : id: ${info.id}` : "";
40
+ return `${info.timestamp} [${this.serviceName}] ${info.level}: ${msg}${idPart}`;
41
41
  }));
42
42
  }
43
43
  winston = winston.createLogger({
@@ -135,9 +135,10 @@ export default class LoggerService {
135
135
  topic: this.kafkaTopic,
136
136
  messages: [{
137
137
  value: JSON.stringify({
138
- ...info,
139
138
  service: this.serviceName,
139
+ id: info.id || null,
140
140
  env: this.environment,
141
+ ...info,
141
142
  timestamp: new Date().toISOString()
142
143
  })
143
144
  }]