Code commit for BAEL-4999

This commit is contained in:
Bhabani Prasad Patel 2021-06-02 10:38:49 +05:30
parent d09d136a1d
commit 9df4fd7d75
2 changed files with 18 additions and 0 deletions

View File

@ -15,6 +15,11 @@
</parent>
<dependencies>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180130</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>

View File

@ -46,11 +46,24 @@
<subject>BAELDUNG: %logger{20} - %msg</subject>
<layout class="ch.qos.logback.classic.html.HTMLLayout"/>
</appender>
<appender name="mask" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="com.baeldung.logback.MaskingPatternLayout">
<maskPattern>\"SSN\"\s*:\s*\"(.*?)\"</maskPattern> <!-- SSN JSON pattern -->
<maskPattern>\"address\"\s*:\s*\"(.*?)\"</maskPattern> <!-- Address JSON pattern -->
<maskPattern>(\d+\.\d+\.\d+\.\d+)</maskPattern> <!-- Ip address IPv4 pattern -->
<maskPattern>(\w+@\w+\.\w+)</maskPattern> <!-- Email pattern -->
<pattern>%-5p [%d{ISO8601,UTC}] [%thread] %c: %m%n%rootException</pattern>
</layout>
</encoder>
</appender>
<root level="info">
<appender-ref ref="map"/>
<appender-ref ref="out"/>
<appender-ref ref="emailAppender"/>
<appender-ref ref="mask" />
</root>
</configuration>