@midwayjs/core 3.14.11 → 3.14.12

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.
@@ -92,28 +92,24 @@ class BaseFramework {
92
92
  return this.app;
93
93
  }
94
94
  createContextLogger(ctx, name) {
95
- const appLogger = this.getLogger(name !== null && name !== void 0 ? name : this.contextLoggerApplyLogger);
96
- if (name) {
95
+ if (name && name !== 'appLogger') {
96
+ const appLogger = this.getLogger(name);
97
97
  let ctxLoggerCache = ctx.getAttr(constants_1.REQUEST_CTX_LOGGER_CACHE_KEY);
98
98
  if (!ctxLoggerCache) {
99
99
  ctxLoggerCache = new Map();
100
100
  ctx.setAttr(constants_1.REQUEST_CTX_LOGGER_CACHE_KEY, ctxLoggerCache);
101
101
  }
102
- if (!name) {
103
- name = 'appLogger';
104
- }
105
102
  // if logger exists
106
103
  if (ctxLoggerCache.has(name)) {
107
104
  return ctxLoggerCache.get(name);
108
105
  }
109
106
  // create new context logger
110
- const ctxLogger = this.loggerService.createContextLogger(ctx, appLogger, {
111
- contextFormat: this.contextLoggerFormat,
112
- });
107
+ const ctxLogger = this.loggerService.createContextLogger(ctx, appLogger);
113
108
  ctxLoggerCache.set(name, ctxLogger);
114
109
  return ctxLogger;
115
110
  }
116
111
  else {
112
+ const appLogger = this.getLogger(name !== null && name !== void 0 ? name : this.contextLoggerApplyLogger);
117
113
  // avoid maximum call stack size exceeded
118
114
  if (ctx['_logger']) {
119
115
  return ctx['_logger'];
@@ -28,7 +28,7 @@ export declare class DefaultConsoleLoggerFactory implements LoggerFactory<ILogge
28
28
  };
29
29
  };
30
30
  };
31
- createContextLogger(ctx: any, appLogger: ILogger): ILogger;
31
+ createContextLogger(ctx: any, appLogger: ILogger, contextOptions?: any): ILogger;
32
32
  getClients(): Map<string, ILogger>;
33
33
  getClientKeys(): string[];
34
34
  }
@@ -28,7 +28,7 @@ class DefaultConsoleLoggerFactory {
28
28
  },
29
29
  };
30
30
  }
31
- createContextLogger(ctx, appLogger) {
31
+ createContextLogger(ctx, appLogger, contextOptions) {
32
32
  return appLogger;
33
33
  }
34
34
  getClients() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/core",
3
- "version": "3.14.11",
3
+ "version": "3.14.12",
4
4
  "description": "midway core",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -42,5 +42,5 @@
42
42
  "engines": {
43
43
  "node": ">=12"
44
44
  },
45
- "gitHead": "a24b455e0b55cda9563236b35f9b49b600920642"
45
+ "gitHead": "e6b0c2d35c4fb8dc05fe17fbc546a09a0b6c0486"
46
46
  }