Socket
Socket
Sign inDemoInstall

log4js-masking-appender-new

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

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.


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 03 Jun 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc