uk.gov.dwp.logging.Sanitiser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of encoded-logger-output Show documentation
Show all versions of encoded-logger-output Show documentation
Wrapper class to sanitise log output and mitigate possible log forging
package uk.gov.dwp.logging;
public class Sanitiser {
private static final String LOG_STANDARD_REGEX = "[\\u0000-\\u001f]";
public String sanitise(String original) {
return original.replaceAll(LOG_STANDARD_REGEX, "");
}
}