mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(core): Support multiple log scopes (#11318)
This commit is contained in:
@@ -40,7 +40,7 @@ export class JobProcessor {
|
||||
private readonly nodeTypes: NodeTypes,
|
||||
private readonly instanceSettings: InstanceSettings,
|
||||
) {
|
||||
this.logger = this.logger.withScope('scaling');
|
||||
this.logger = this.logger.scoped('scaling');
|
||||
}
|
||||
|
||||
async processJob(job: Job): Promise<JobResult> {
|
||||
|
||||
@@ -36,7 +36,7 @@ export class MultiMainSetup extends TypedEmitter<MultiMainEvents> {
|
||||
private readonly globalConfig: GlobalConfig,
|
||||
) {
|
||||
super();
|
||||
this.logger = this.logger.withScope('scaling');
|
||||
this.logger = this.logger.scoped(['scaling', 'multi-main-setup']);
|
||||
}
|
||||
|
||||
private leaderKey: string;
|
||||
|
||||
@@ -26,7 +26,7 @@ export class Publisher {
|
||||
// @TODO: Once this class is only ever initialized in scaling mode, throw in the next line instead.
|
||||
if (config.getEnv('executions.mode') !== 'queue') return;
|
||||
|
||||
this.logger = this.logger.withScope('scaling');
|
||||
this.logger = this.logger.scoped(['scaling', 'pubsub']);
|
||||
|
||||
this.client = this.redisClientService.createClient({ type: 'publisher(n8n)' });
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ export class Subscriber {
|
||||
// @TODO: Once this class is only ever initialized in scaling mode, throw in the next line instead.
|
||||
if (config.getEnv('executions.mode') !== 'queue') return;
|
||||
|
||||
this.logger = this.logger.withScope('scaling');
|
||||
this.logger = this.logger.scoped(['scaling', 'pubsub']);
|
||||
|
||||
this.client = this.redisClientService.createClient({ type: 'subscriber(n8n)' });
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ export class ScalingService {
|
||||
private readonly orchestrationService: OrchestrationService,
|
||||
private readonly eventService: EventService,
|
||||
) {
|
||||
this.logger = this.logger.withScope('scaling');
|
||||
this.logger = this.logger.scoped('scaling');
|
||||
}
|
||||
|
||||
// #region Lifecycle
|
||||
|
||||
@@ -58,7 +58,7 @@ export class WorkerServer {
|
||||
) {
|
||||
assert(this.instanceSettings.instanceType === 'worker');
|
||||
|
||||
this.logger = this.logger.withScope('scaling');
|
||||
this.logger = this.logger.scoped('scaling');
|
||||
|
||||
this.app = express();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user