Mask sensitive data in logs with logback

You need to wrap layout using LayoutWrappingEncoder. And also I believe you cannot use spring here as logback is not managed by spring. Here is the updated class. public class MaskingPatternLayout extends PatternLayout { private String patternsProperty; public String getPatternsProperty() { return patternsProperty; } public void setPatternsProperty(String patternsProperty) { this.patternsProperty = patternsProperty; } @Override public … Read more

Implement an input with a mask

Input masks can be implemented using a combination of the keyup event, and the HTMLInputElement value, selectionStart, and selectionEnd properties. Here’s a very simple implementation which does some of what you want. It’s certainly not perfect, but works well enough to demonstrate the principle: Array.prototype.forEach.call(document.body.querySelectorAll(“*[data-mask]”), applyDataMask); function applyDataMask(field) { var mask = field.dataset.mask.split(”); // For … Read more