mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
refactor(core): Enrich relay-execution-lifecycle-event logs (#12165)
This commit is contained in:
@@ -7,6 +7,7 @@ import { Service } from 'typedi';
|
||||
import config from '@/config';
|
||||
import { EventService } from '@/events/event.service';
|
||||
import { Logger } from '@/logging/logger.service';
|
||||
import type { LogMetadata } from '@/logging/types';
|
||||
import { RedisClientService } from '@/services/redis-client.service';
|
||||
|
||||
import type { PubSub } from './pubsub.types';
|
||||
@@ -72,7 +73,7 @@ export class Subscriber {
|
||||
});
|
||||
|
||||
if (!msg) {
|
||||
this.logger.error(`Received malformed message via channel ${channel}`, {
|
||||
this.logger.error('Received malformed pubsub message', {
|
||||
msg: str,
|
||||
channel,
|
||||
});
|
||||
@@ -89,12 +90,18 @@ export class Subscriber {
|
||||
return null;
|
||||
}
|
||||
|
||||
const msgName = 'command' in msg ? msg.command : msg.response;
|
||||
let msgName = 'command' in msg ? msg.command : msg.response;
|
||||
|
||||
this.logger.debug(`Received message ${msgName} via channel ${channel}`, {
|
||||
msg,
|
||||
channel,
|
||||
});
|
||||
const metadata: LogMetadata = { msg: msgName, channel };
|
||||
|
||||
if ('command' in msg && msg.command === 'relay-execution-lifecycle-event') {
|
||||
const { args, type } = msg.payload;
|
||||
msgName += ` (${type})`;
|
||||
metadata.type = type;
|
||||
metadata.executionId = args.executionId;
|
||||
}
|
||||
|
||||
this.logger.debug(`Received pubsub msg: ${msgName}`, metadata);
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user