@edirect/logger 11.0.24 → 11.0.25

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.
@@ -1,3 +1,4 @@
1
+ import { Level } from 'pino';
1
2
  export interface LoggerModuleOptions {
2
3
  output?: string;
3
4
  logs?: {
@@ -6,7 +7,10 @@ export interface LoggerModuleOptions {
6
7
  infoFile: string;
7
8
  exceptionsFile?: string;
8
9
  };
9
- host?: string;
10
10
  name?: string;
11
+ host?: string;
12
+ protocol?: string;
13
+ version?: string;
14
+ level?: Level;
11
15
  }
12
16
  //# sourceMappingURL=logger-module-options.interface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logger-module-options.interface.d.ts","sourceRoot":"","sources":["../../../../src/logger/interfaces/logger-module-options.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE;QACL,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
1
+ {"version":3,"file":"logger-module-options.interface.d.ts","sourceRoot":"","sources":["../../../../src/logger/interfaces/logger-module-options.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAE7B,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE;QACL,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf"}
@@ -1,39 +1,22 @@
1
- export interface LogConfigs {
2
- logs?: {
3
- errorFile?: string;
4
- warningFile?: string;
5
- infoFile?: string;
6
- exceptionsFile?: string;
7
- };
8
- host?: string;
9
- name?: string;
10
- protocol?: string;
11
- version?: string;
12
- }
1
+ import { LoggerModuleOptions } from './interfaces/logger-module-options.interface';
13
2
  export interface LogMetadata {
14
- timestamp: string;
15
- application?: string;
16
- version?: string;
17
- host?: string;
18
- protocol?: string;
19
3
  'remote-address'?: string;
20
- level?: string;
4
+ sessionId?: string;
5
+ quoteId?: string;
21
6
  payload?: any;
22
- sessionId: string;
23
- quoteId: string;
24
7
  }
25
8
  export declare class Logger {
26
9
  private sessionId;
27
10
  private quoteId;
28
- private configs?;
11
+ private configs;
29
12
  private logger;
30
- constructor(clientConfigs?: LogConfigs);
31
- debug(message: string): void;
32
- info(message: string, payload?: any, address?: string): void;
33
- warning(message: string, payload?: any): void;
34
- warn(message: string, payload?: any): void;
35
- error(message: string, payload?: any): void;
36
- verbose(message: string): void;
13
+ constructor(env: Record<string, string>, options?: LoggerModuleOptions);
14
+ debug(message: string, payload?: any, remoteAddress?: string): void;
15
+ info(message: string, payload?: any, remoteAddress?: string): void;
16
+ warning(message: string, payload?: any, remoteAddress?: string): void;
17
+ warn(message: string, payload?: any, remoteAddress?: string): void;
18
+ error(message: string, payload?: any, remoteAddress?: string): void;
19
+ verbose(message: string, remoteAddress?: string): void;
37
20
  setSessionId(sessionId: string): void;
38
21
  setQuoteId(quoteId: string): void;
39
22
  private buildLog;
@@ -1 +1 @@
1
- {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/logger/log.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE;QACL,SAAS,C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AC,EAAE,MAAM,GAAG,IAAI;IAInE,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI;IAItD,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAIrC,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIjC,OAAO,CAAC,QAAQ;CAQjB"}
@@ -3,36 +3,115 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Logger = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  /* eslint-disable @typescript-eslint/no-explicit-any */
6
- const pino_1 = tslib_1.__importDefault(require("pino"));
6
+ const pino_1 = tslib_1.__importStar(require("pino"));
7
7
  class Logger {
8
8
  sessionId = '';
9
9
  quoteId = '';
10
10
  configs;
11
11
  logger;
12
- constructor(clientConfigs) {
13
- this.configs = clientConfigs || {};
14
- this.logger = (0, pino_1.default)();
12
+ constructor(env, options) {
13
+ const defaults = {
14
+ logs: {
15
+ infoFile: env.LOGS_INFO_FILE,
16
+ warningFile: env.LOGS_WARNING_FILE,
17
+ errorFile: env.LOGS_ERROR_FILE,
18
+ exceptionsFile: env.LOGS_EXCEPTIONS_FILE,
19
+ },
20
+ level: env.LOGS_LEVEL?.toLowerCase() || 'info',
21
+ output: env.LOGS_OUTPUT ?? 'console',
22
+ name: env.npm_package_name ?? env.APP_NAME ?? 'app',
23
+ version: env.npm_package_version ?? env.APP_VERSION ?? '0.0.0',
24
+ host: env.LOGS_HOST ?? '0.0.0.0',
25
+ protocol: env.LOGS_PROTOCOL ?? 'http',
26
+ };
27
+ this.configs = { ...defaults, ...options };
28
+ const streams = [];
29
+ if (this.configs.output === 'file' || this.configs.output === 'both') {
30
+ if (this.configs.logs?.infoFile) {
31
+ streams.push({
32
+ level: 'info',
33
+ stream: pino_1.default.destination({
34
+ dest: this.configs.logs.infoFile,
35
+ mkdir: true,
36
+ sync: false,
37
+ }),
38
+ });
39
+ }
40
+ if (this.configs.logs?.warningFile) {
41
+ streams.push({
42
+ level: 'warn',
43
+ stream: pino_1.default.destination({
44
+ dest: this.configs.logs.warningFile,
45
+ mkdir: true,
46
+ sync: false,
47
+ }),
48
+ });
49
+ }
50
+ if (this.configs.logs?.errorFile) {
51
+ streams.push({
52
+ level: 'error',
53
+ stream: pino_1.default.destination({
54
+ dest: this.configs.logs.errorFile,
55
+ mkdir: true,
56
+ sync: false,
57
+ }),
58
+ });
59
+ }
60
+ }
61
+ if (this.configs.output === 'console' || this.configs.output === 'both') {
62
+ streams.push({
63
+ level: this.configs.level,
64
+ stream: process.stdout,
65
+ });
66
+ }
67
+ this.logger = (0, pino_1.default)({
68
+ level: this.configs.level,
69
+ timestamp: () => `,"timestamp":"${new Date(Date.now()).toISOString()}"`,
70
+ base: {
71
+ name: this.configs.name,
72
+ version: this.configs.version,
73
+ host: this.configs.host,
74
+ protocol: this.configs.protocol,
75
+ },
76
+ formatters: {
77
+ level: label => ({ level: label }),
78
+ },
79
+ }, (0, pino_1.multistream)(streams));
80
+ if (this.configs.logs?.exceptionsFile) {
81
+ const exceptionLogger = (0, pino_1.default)({
82
+ timestamp: () => `,"timestamp":"${new Date(Date.now()).toISOString()}"`,
83
+ }, pino_1.default.destination({
84
+ dest: this.configs.logs.exceptionsFile,
85
+ mkdir: true,
86
+ sync: true,
87
+ }));
88
+ process.on('uncaughtException', err => {
89
+ exceptionLogger.fatal({ err }, 'Uncaught exception');
90
+ process.exit(1);
91
+ });
92
+ process.on('unhandledRejection', reason => {
93
+ exceptionLogger.fatal({ reason }, 'Unhandled rejection');
94
+ process.exit(1);
95
+ });
96
+ }
15
97
  }
16
- debug(message) {
17
- this.logger.debug(message);
98
+ debug(message, payload, remoteAddress) {
99
+ this.logger.debug(this.buildLog(payload, remoteAddress), message);
18
100
  }
19
- info(message, payload, address = '0.0.0.0') {
20
- const metadata = this.buildLog('info', payload, address);
21
- this.logger.info(metadata, message);
101
+ info(message, payload, remoteAddress) {
102
+ this.logger.info(this.buildLog(payload, remoteAddress), message);
22
103
  }
23
- warning(message, payload) {
24
- const metadata = this.buildLog('warn', payload);
25
- this.logger.warn(metadata, message);
104
+ warning(message, payload, remoteAddress) {
105
+ this.logger.warn(this.buildLog(payload, remoteAddress), message);
26
106
  }
27
- warn(message, payload) {
28
- this.warning(message, payload);
107
+ warn(message, payload, remoteAddress) {
108
+ this.warning(message, payload, remoteAddress);
29
109
  }
30
- error(message, payload) {
31
- const metadata = this.buildLog('error', payload);
32
- this.logger.error(metadata, message);
110
+ error(message, payload, remoteAddress) {
111
+ this.logger.error(this.buildLog(payload, remoteAddress), message);
33
112
  }
34
- verbose(message) {
35
- this.info(message);
113
+ verbose(message, remoteAddress) {
114
+ this.info(message, remoteAddress);
36
115
  }
37
116
  setSessionId(sessionId) {
38
117
  this.sessionId = sessionId;
@@ -40,15 +119,12 @@ class Logger {
40
119
  setQuoteId(quoteId) {
41
120
  this.quoteId = quoteId;
42
121
  }
43
- buildLog(level, payload, address = '0.0.0.0') {
122
+ buildLog(payload, remoteAddress) {
44
123
  return {
45
- ...(this.configs ?? {}),
46
- timestamp: new Date().toLocaleString(),
47
- 'remote-address': address,
48
- level: level,
49
- payload: payload,
50
- sessionId: this.sessionId,
51
- quoteId: this.quoteId,
124
+ ...(remoteAddress && { 'remote-address': remoteAddress }),
125
+ ...(this.sessionId && { sessionId: this.sessionId }),
126
+ ...(this.quoteId && { quoteId: this.quoteId }),
127
+ payload,
52
128
  };
53
129
  }
54
130
  }
@@ -1,9 +1,9 @@
1
1
  import { LoggerService } from '@nestjs/common';
2
- import { Logger as LoggerImpl } from './log';
3
2
  import { LoggerModuleOptions } from './interfaces/logger-module-options.interface';
3
+ import { Logger as LoggerImpl } from './log';
4
4
  export declare class Logger implements LoggerService {
5
5
  private logger;
6
- constructor(config?: LoggerModuleOptions, logger?: LoggerImpl);
6
+ constructor(env: Record<string, string>, clientConfigs?: LoggerModuleOptions, logger?: LoggerImpl);
7
7
  setSessionId(sessionId: string): void;
8
8
  setQuoteId(quoteId: string): void;
9
9
  log(message: string, payload?: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"logger.class.d.ts","sourceRoot":"","sources":["../../../src/logger/logger.class.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AAEnF,qBAAa,MAAO,YAAW,aAAa;IAGxC,OAAO,CAAC,MAAM;gBADd,MAAM,CAAC,EAAE,mBAAmB,EACpB,MAAM,aAAyB;IAGzC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAIrC,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIjC,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAI5C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAI7C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAI5C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAI7C,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI5B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAG/B"}
1
+ {"version":3,"file":"logger.class.d.ts","sourceRoot":"","sources":["../../../src/logger/logger.class.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,OAAO,CAAC;AAE7C,qBAAa,MAAO,YAAW,aAAa;IAIxC,OAAO,CAAC,MAAM;gBAFd,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC3B,aAAa,CAAC,EAAE,mBAAmB,EAC3B,MAAM,aAAqC;IAGrD,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAIrC,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIjC,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAI5C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAI7C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAI5C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAI7C,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI5B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAG/B"}
@@ -4,7 +4,7 @@ exports.Logger = void 0;
4
4
  const log_1 = require("./log");
5
5
  class Logger {
6
6
  logger;
7
- constructor(config, logger = new log_1.Logger(config)) {
7
+ constructor(env, clientConfigs, logger = new log_1.Logger(env, clientConfigs)) {
8
8
  this.logger = logger;
9
9
  }
10
10
  setSessionId(sessionId) {
@@ -1 +1 @@
1
- {"version":3,"file":"logger.service.d.ts","sourceRoot":"","sources":["../../../src/logger/logger.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AAExF,qBACa,aAAa;IAIC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAGrD,OAAO,CAAC,OAAO,CAAC;IANlB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAGU,aAAa,EAAE,aAAa,EAG5D,OAAO,CAAC,EAAE,mBAAmB,YAAA;IAiBvC,YAAY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AI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAI7C,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI5B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAG/B"}
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LoggerService = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const common_1 = require("@nestjs/common");
6
5
  const config_1 = require("@edirect/config");
6
+ const common_1 = require("@nestjs/common");
7
7
  const logger_class_1 = require("./logger.class");
8
8
  const logger_module_definition_1 = require("./logger.module.definition");
9
9
  let LoggerService = class LoggerService {
@@ -13,17 +13,7 @@ let LoggerService = class LoggerService {
13
13
  constructor(configService, options) {
14
14
  this.configService = configService;
15
15
  this.options = options;
16
- // TODO Preventing break changes. Once all services use the module register or registerAsync configuration update this part to not be necessary to get direct from @edirect/config
17
- const envConfig = this.configService.getConfig();
18
- const config = {
19
- // TODO Turn output non options in LoggerModuleOptions after adpat all services to use this new logger module version
20
- output: this.options?.output || envConfig.LOGS_OUTPUT || 'console',
21
- // TODO Check if quote-engine is required in one of the microservices as default and change to get the default name from the logger module
22
- name: this.options?.name || 'quote-engine',
23
- host: this.options?.host || envConfig.LOGS_HOST,
24
- };
25
- // TODO After adapt all the services to the new Logger Module version use the LoggerModuleOptions directly to setup the module
26
- this.logger = new logger_class_1.Logger(config);
16
+ this.logger = new logger_class_1.Logger(this.configService.getConfig(), this.options);
27
17
  }
28
18
  setSessionId(sessionId) {
29
19
  this.logger.setSessionId(sessionId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edirect/logger",
3
- "version": "11.0.24",
3
+ "version": "11.0.25",
4
4
  "packageScope": "@edirect",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
@@ -21,7 +21,7 @@
21
21
  "pino": "9.9.0",
22
22
  "supertest": "7.1.4",
23
23
  "tslib": "^2.8.1",
24
- "@edirect/config": "11.0.24"
24
+ "@edirect/config": "11.0.25"
25
25
  },
26
26
  "nx": {
27
27
  "name": "@edirect/logger",