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