1

I want to mask track data , card data and etc , my pattern of logging is as follows plain text : userID=1234|trackData=789654asdas|pin=897|userName=445566 Masked text : userID=1234|trackData=|pin=|userName=445566

i don't want to print this data which is sensitive , is there any way to do so , also i am not using spring boot or spring mvc architecture , this is normal rest api's.

  • 4
    The best plan is to mask the data *before* you create the log entry. For example, if the above is the result of calling `toString()` on an object, change the `toString()` method, or create the log message in a way that doesn't call `toString()`. – Stephen C Jan 02 '22 at 02:25

0 Answers0