I want to understand if there is anyway I can mask certain
string variables of a class like password, etc which will prevent during logging. Like overriding .toString() method in such way it does not print in logs.
For instance:-
We have a class Employee with following fields:-
During logging like
Here in logging, I'm trying to print the whole object, Employee here and my requirement is it should not print out masked field, password at all and whereas logging of rest of the fields are fine.
Thank you,