log4js-filters
This is a log filtering plugin for log4js-node. It checks log object keys against pre-configured words or regex and hide the log content accordingly. See below for an example.
NOTE: Logs have to be of object form. Strings won't get filtered.
Installation
npm install --save log4js-filters
Usage
// Example to filter password and any email in logs. const log4js layout = ; // Add a filter to catch "password" keylayoutexact = 'password'; // Add a filter to catch any key containing "email"layoutregex = 'email'; log4js; const logger = log4js;logger;
Output:
[DEBUG] default -