Class SensitiveMasker
java.lang.Object
com.github.catomat0.aoploghelper.logging.mask.SensitiveMasker
Best-effort masker used when logging method arguments, return values and exception messages.
Two independent layers:
- Keyword layer —
Mapentries andkey=value/"key":"value"string pairs whose key contains any configured keyword are replaced with"***". - PII layer — regex-based masking for e-mail, phone numbers, credit cards and Korean resident-registration numbers, applied to any string content.
sanitizeForLog(String) also strips control characters
(\n, \r, \t, ESC) to defeat log-line injection.
This is NOT a security boundary — do not rely on it to sanitize data leaving the process.
-
Constructor Summary
ConstructorsConstructorDescriptionSensitiveMasker(Collection<String> keywords) SensitiveMasker(Collection<String> keywords, boolean piiEnabled) -
Method Summary
-
Constructor Details
-
SensitiveMasker
-
SensitiveMasker
-
-
Method Details
-
mask
-
sanitizeForLog
Runs full masking and then strips control characters so the result is safe to embed in a single log line. Use this on any string that mixes user-controlled content into the log. -
maskArgs
-