I have a class that contains confidential information (credit card information, phone numbers, etc.).
I want this class to be able to pass in log4j, but it should hide certain information.
If I have a UserInformation class that has getPhoneNumber, getCreditCardNumber methods, how can I configure log4j or this class to hide numbers correctly.
I want the credit card number to be displayed as xxxx-xxxx-xxxx-1234, and the phone number to be displayed as xxxx-xxx-xxx, given that these will be 1234-1234-1234-1234 and 1234-567-890
thank
source
share