chore: make sure to redact secrets in meta fields

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2024-04-23 12:56:02 +02:00
parent e71681e669
commit 8fa9cb6a08
@@ -87,11 +87,12 @@ export class WinstonLogger implements RootLoggerService {
return {
format: format(info => {
if (redactionPattern && typeof info.message === 'string') {
info.message = info.message.replace(redactionPattern, '[REDACTED]');
}
if (redactionPattern && typeof info.stack === 'string') {
info.stack = info.stack.replace(redactionPattern, '[REDACTED]');
if (redactionPattern) {
for (const [key, value] of Object.entries(info)) {
if (typeof value === 'string') {
info[key] = value.replace(redactionPattern, '[REDACTED]');
}
}
}
return info;
})(),