
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
log4js-masking-appender-new
Advanced tools
This is a Javascript masking appender for [log4js](https://www.npmjs.com/package/log4js). It is used to mask confidential information in string and objects before console logging it, but it doesn't change the original input.
This is a Javascript masking appender for log4js. It is used to mask confidential information in string and objects before console logging it, but it doesn't change the original input.
Use the package manager npm to install log4js-masking-appender.
npm install log4js --save
npm install log4js-masking-appender-new --save
const log4js = require("log4js");
log4js.configure({
appenders: {
console: {type: 'console'},
masking: {
type: 'log4js-masking-appender-new',
},
},
categories: {
default: {appenders: ['masking'], level: 'ALL'},
},
});
logger = log4js.getLogger();
// Example of Object Masking
let obj = {
"mobile": "123456789",
"FullName": "Hello World!!",
"District": "La Jolla, San Diego"
}
// Case (1)
logger.info(obj)
// Case (2)
logger.error(obj)
Expected output
# Case (1)
[2020-11-15T13:56:57.886] [INFO] default - { mobile: '123456789', FullName: '*******', District: '*******' }
# Case (2)
[2020-11-15T13:56:57.892] [ERROR] default - { mobile: '123456789', FullName: '*******', District: '*******' }
Please recommend any keyowrds to be added, below are the ones included currently
keywords = {
"FullName",
"FirstName",
"LastName",
"ContactInfo",
"Gender",
"District",
"subscriberNo",
"SubscriberNo",
"CustomerNo",
"NS1:CustomerNo",
"serviceNumber",
"callerId",
"callerPassword",
"username",
"Username",
"U",
"P",
"wsse:Username",
"password",
"wsse:Password",
"Password",
"fullphone",
"FullPhone",
"PhoneNumber",
"adslNumber",
"hostname",
"port",
"host",
"CustomerContactNumber",
"CustomerAccountNumber",
"Authorization",
"headers",
"Followup_Number",
"followup_Number",
"tem:ServiceNumber",
"CallerPassword",
"CallerID",
"authkey"
}
FAQs
This is a Javascript masking appender for [log4js](https://www.npmjs.com/package/log4js). It is used to mask confidential information in string and objects before console logging it, but it doesn't change the original input.
We found that log4js-masking-appender-new demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.