From 0ef810613d77f1af9499627a9513882529506790 Mon Sep 17 00:00:00 2001 From: Salim Ben Dakhlia Date: Mon, 6 Nov 2023 16:34:13 +0100 Subject: [PATCH] feat: remove sensitive data from pubsub loggers --- src/GoogleCloudPubSub/GoogleCloudPubSub.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/GoogleCloudPubSub/GoogleCloudPubSub.ts b/src/GoogleCloudPubSub/GoogleCloudPubSub.ts index 80499ee6..fbb9ef80 100644 --- a/src/GoogleCloudPubSub/GoogleCloudPubSub.ts +++ b/src/GoogleCloudPubSub/GoogleCloudPubSub.ts @@ -132,7 +132,7 @@ export class GoogleCloudPubSub implements GCPubSub { const extendedMessage: ExtendedMessage = new ExtendedMessage(message); this.logger.debug( - { ...extendedMessage, originalMessage: undefined }, + { ...extendedMessage, payload: undefined, originalMessage: undefined }, `A message has been received for Subscription ${subscription.name} after ${ message.received - message.publishTime.valueOf() } ms`, @@ -169,12 +169,7 @@ export class GoogleCloudPubSub implements GCPubSub { opts: EmitOptions = {}, ): Promise { const topic: Topic = await this.getOrCreateTopic(event, opts.options?.topicOptions, opts.options?.publishOptions); - this.logger.debug( - { - data, - }, - `Found topic ${topic.name} for event ${event}`, - ); + this.logger.debug(`Found topic ${topic.name} for event ${event}`); const attributes: Attributes = { ...opts.options?.messageOptions?.attributes }; @@ -188,7 +183,6 @@ export class GoogleCloudPubSub implements GCPubSub { this.logger.debug( { - data, attributes, }, `Sending payload to Topic ${topic.name}`,