The logger performs key-name-based redaction on all structured metadata passed to logger.info(), logger.error(), etc. If an object key matches an entry in the denylist, its value is replaced with [REDACTED] before the log entry is written.
Authentication secrets:
pk,privateKey,password,token,secret
KYC PII fields:
fullName— Full legal namedateOfBirth— Date of birthemail— Email addressphoneNumber— Phone numberaddressLine1,addressLine2— Street address linespostalCode— Postal / ZIP codecountryCode— Country code
KYC document fields:
documentId— Government-issued document number (passport, national ID, etc.)fileUrl— Uploaded document file URL
The redaction is applied recursively via redactSensitiveData() — nested objects and arrays are traversed and any key matching the denylist is replaced. The denylist is defined in src/config/logger.ts as the SENSITIVE_FIELDS array.
Add new field names to the SENSITIVE_FIELDS array in src/config/logger.ts. Both camelCase and snake_case variants should be added if the field is expected in either form.