diff --git a/core/algorithm-debug/config/logger/config.base.js b/core/algorithm-debug/config/logger/config.base.js index 76dc1e20d..58fa1f1b0 100644 --- a/core/algorithm-debug/config/logger/config.base.js +++ b/core/algorithm-debug/config/logger/config.base.js @@ -10,6 +10,7 @@ config.transport = { config.console = { json: false, colors: false, + format: 'wrapper::{level}::{message}', level: process.env.HKUBE_LOG_LEVEL, }; config.file = { diff --git a/core/worker/lib/consumer/JobConsumer.js b/core/worker/lib/consumer/JobConsumer.js index 636bf4906..f40a17432 100644 --- a/core/worker/lib/consumer/JobConsumer.js +++ b/core/worker/lib/consumer/JobConsumer.js @@ -24,6 +24,7 @@ class JobConsumer extends EventEmitter { this._job = null; this._jobId = undefined; this._taskId = undefined; + this._loggingInfo = {}; this._nodeName = undefined; this._batchIndex = undefined; this._pipelineName = undefined; @@ -130,6 +131,7 @@ class JobConsumer extends EventEmitter { this._job = job; this._kind = job.data.kind; this._jobId = job.data.jobId; + this._loggingInfo = { jobId: job.data.jobId, taskId: job.data.taskId, pipelineName: job.data.pipelineName, batchIndex: job.data.batchIndex }; this._taskId = job.data.taskId; this._execId = job.data.execId; this._nodeName = job.data.nodeName; @@ -325,11 +327,11 @@ class JobConsumer extends EventEmitter { currentTaskInfo() { return { - jobId: this._jobId, - taskId: this._taskId, - pipelineName: this._pipelineName, + jobId: this._loggingInfo.jobId, + taskId: this._loggingInfo.taskId, + pipelineName: this._loggingInfo.pipelineName, algorithmName: this.getAlgorithmType(), - batchIndex: this._batchIndex + batchIndex: this._loggingInfo.batchIndex }; }