title: How to Sanitise the logged data when using log4j2?
body: <p>I need to validate the logs currently being written using log4j2 for sanitizing the input passed to it. I see ESAPI API provides an option to sanitize the input passed to it.</p>
  
  <p>My question is I am not sure how I can use the ESAPI with logging methods.</p>
  
  <p>Is there something like a filter or interceptor which I need to add for while logging in my methods to transparently filter and sanitise the logged text accordingly or should I write a custom Logger Class which extends the base Logger class and then logs accordingly by wrapping the call to ESAPI api.</p>
  
  <p>If anyone has faced a similar issue can you please help me on this.</p>