🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

log4js-masking-appender-new

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

log4js-masking-appender-new

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.

latest
Source
npmnpm
Version
2.13.7
Version published
Maintainers
1
Created
Source

log4js-masking-appender

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.

Installation

Use the package manager npm to install log4js-masking-appender.

npm install log4js --save
npm install log4js-masking-appender-new --save

Usage

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: '*******' }

Current Masking Information

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"
}

Keywords

appender

FAQs

Package last updated on 03 Jun 2022

Did you know?

Socket

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.

Install

Related posts