We are using log4net library for write logs in a file. Actually we have a payment form where we are accepting three fields
- Card Holder Name(max length 50)
- Card Number(Valid credit card number i.e Master/Visa etc) and
- Reference(this is just a text file, max length user can input any string or integer value).
When the user submits these values we log these input (Except card number because we have masked it before storing into the log file) in a file. But because the user can input any string or integer into the reference field so there is a possibility the user can input card number into this field and then it will be written into the log file. So how we can protect this field so users are not able to add a card number into this field?