Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NO-1748] Remove sensitive data from Pubsub loggers #544

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/GoogleCloudPubSub/GoogleCloudPubSub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export class GoogleCloudPubSub implements GCPubSub {
const extendedMessage: ExtendedMessage<T> = new ExtendedMessage<T>(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`,
Expand Down Expand Up @@ -169,12 +169,7 @@ export class GoogleCloudPubSub implements GCPubSub {
opts: EmitOptions<GCListenOptions> = {},
): Promise<string> {
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 };

Expand All @@ -188,7 +183,6 @@ export class GoogleCloudPubSub implements GCPubSub {

this.logger.debug(
{
data,
attributes,
},
`Sending payload to Topic ${topic.name}`,
Expand Down