I am trying to mask sensitive information like SSN and Credit card in my Spring boot application using Logback.xml. I searched various links in web, but could not find good solution.Is there a simple-way or any library to mask the sensitive information in logs?
Input
{"firstName":"John","lastName":"Doe","SSN":123456789}
output:
{"firstName":"John","lastName":"Doe","SSN":12345****}
And found this on stack overflow but trouble figuring out regex.Any help would be greatly appreciated