Skip to content

Commit

Permalink
Merge pull request #77 from navikt/add-logback-configuration
Browse files Browse the repository at this point in the history
update default logback configurationi
  • Loading branch information
antonfofanov authored Jan 12, 2024
2 parents c17c629 + 5ff5427 commit 0deac63
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>

<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<appender name="STDOUT_JSON" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<maxLength>15000</maxLength>
<maxDepthPerThrowable>30</maxDepthPerThrowable>
<exclude>java\.util\.concurrent\..*</exclude>
<exclude>org\.apache\.tomcat\..*</exclude>
<exclude>org\.apache\.coyote\..*</exclude>
<exclude>org\.apache\.catalina\..*</exclude>
<exclude>org\.springframework\.web\..*</exclude>
</throwableConverter>
<jsonGeneratorDecorator class="net.logstash.logback.mask.MaskingJsonGeneratorDecorator">
<valueMask>
<value>(.*)(\d{6})\d{5}(.*)</value>
Expand All @@ -12,9 +19,8 @@
</jsonGeneratorDecorator>
</encoder>
</appender>

<root level="WARN">
<appender-ref ref="stdout_json"/>
<root level="INFO">
<appender-ref ref="STDOUT_JSON"/>
</root>

<logger name="no.nav.tjenestepensjon" level="${logging.level.no.nav.tjenestepensjon:-WARN}"/>
Expand All @@ -25,4 +31,4 @@
<logger name="org.springframework.ws.web" level="${logging.level.org.springframework.ws.web:-WARN}"/>
<logger name="com.microsoft.aad" level="${logging.level.com.microsoft.aad:-WARN}"/>

</configuration>
</configuration>

0 comments on commit 0deac63

Please sign in to comment.