diff --git a/packages/hook/package.json b/packages/hook/package.json index 22a65408..c559dc5d 100644 --- a/packages/hook/package.json +++ b/packages/hook/package.json @@ -37,7 +37,7 @@ "@types/node": "^8.5.2", "bluebird": "^3.5.1", "chai": "^4.1.2", - "egg-logger": "^1.6.0", + "egg-logger": "^2.0.1", "globby": "^6.1.0", "ioredis": "^3.2.2", "log4js": "^3.0.5", diff --git a/packages/hook/src/patch/EggLogger.ts b/packages/hook/src/patch/EggLogger.ts index a16bfc46..9f720191 100644 --- a/packages/hook/src/patch/EggLogger.ts +++ b/packages/hook/src/patch/EggLogger.ts @@ -21,7 +21,7 @@ export class EggLoggerPatcher extends Patcher { const self = this; const traceManager = this.getTraceManager(); - this.hook('^1.6.x', (loadModule) => { + this.hook('^2.x||^1.6.x', (loadModule) => { const logger = loadModule('lib/logger.js'); self.getShimmer().wrap(logger.prototype, 'log', function logWrapper(log) {