From 124c51071b1b189dabef52d919cbb1d6d3c9a724 Mon Sep 17 00:00:00 2001 From: Nathnael Date: Mon, 10 Aug 2026 06:56:07 +0000 Subject: [PATCH] fix: log email and sms --- .../src/modules/notifications/email-client.service.ts | 7 +++++-- .../src/modules/notifications/sms-client.service.ts | 7 ++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/edr-freight-api/src/modules/notifications/email-client.service.ts b/apps/edr-freight-api/src/modules/notifications/email-client.service.ts index 20a43d061..52dd7802e 100644 --- a/apps/edr-freight-api/src/modules/notifications/email-client.service.ts +++ b/apps/edr-freight-api/src/modules/notifications/email-client.service.ts @@ -51,8 +51,11 @@ export class EmailClientService implements OnApplicationBootstrap { this.logger.log( `EMAIL publish to RabbitMQ [${process.env.EMAIL_QUEUE ?? "email_queue"}] pattern='send-email' confirmed=${queued}`, ); - // Recipient + content are PII — debug only. - this.logger.debug(`EMAIL payload to=${dto.to} subject="${dto.subject}"`); + // Full content logged on purpose (audit of what actually left the API). + // Note: recipient + body are PII and land in plain application logs. + this.logger.log( + `EMAIL payload to=${dto.to} subject="${dto.subject}" text="${dto.text ?? ""}" html="${dto.html ?? ""}"`, + ); return { queued }; } diff --git a/apps/edr-freight-api/src/modules/notifications/sms-client.service.ts b/apps/edr-freight-api/src/modules/notifications/sms-client.service.ts index 43e47f350..1c4f3adba 100644 --- a/apps/edr-freight-api/src/modules/notifications/sms-client.service.ts +++ b/apps/edr-freight-api/src/modules/notifications/sms-client.service.ts @@ -52,8 +52,9 @@ export class SmsClientService implements OnApplicationBootstrap { this.logger.log( `SMS publish to RabbitMQ [${process.env.SMS_QUEUE ?? "sms_queue"}] pattern='send-sms' confirmed=${queued}`, ); - // Recipient + content are PII — debug only. - this.logger.debug(`SMS payload to=${dto.to} text="${dto.message}"`); + // Full content logged on purpose (audit of what actually left the API). + // Note: recipient + body are PII and land in plain application logs. + this.logger.log(`SMS payload to=${dto.to} text="${dto.message}"`); return { queued }; } @@ -81,7 +82,7 @@ export class SmsClientService implements OnApplicationBootstrap { this.logger.log( `BULK SMS publish to RabbitMQ [${process.env.SMS_QUEUE ?? "sms_queue"}] pattern='ozeking-bulk-sms' count=${messages.length} confirmed=${queued}`, ); - this.logger.debug(`BULK SMS payload messages=${JSON.stringify(messages)}`); + this.logger.log(`BULK SMS payload messages=${JSON.stringify(messages)}`); return { queued }; }