chore: make sure to redact secrets in meta fields
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -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;
|
||||
})(),
|
||||
|
||||
Reference in New Issue
Block a user