Skip to content

Commit

Permalink
feat: support for JSON log format (and make it the new default)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgb committed Oct 8, 2023
1 parent e7cb9ef commit 68cb869
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
20 changes: 19 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>no.statnett</groupId>
Expand All @@ -9,6 +10,9 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<kafka.version>3.6.0</kafka.version>
<!-- Must manage Jackson dependencies to avoid conflicts with Scala -->
<!-- Scala module 2.13.5 requires Jackson Databind version >= 2.13.0 and < 2.14.0 - Found jackson-databind version 2.15.2 -->
<jackson.version>2.13.5</jackson.version>
</properties>

<dependencyManagement>
Expand All @@ -21,6 +25,14 @@
<scope>import</scope>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>${jackson.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<!-- Must manage dependency since kafka-clients currently depends on slf4j 1.x -->
<dependency>
<groupId>org.slf4j</groupId>
Expand All @@ -43,6 +55,12 @@
<version>1.4.11</version>
</dependency>

<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>7.4</version>
</dependency>

<dependency>
<groupId>com.typesafe</groupId>
<artifactId>config</artifactId>
Expand Down
6 changes: 2 additions & 4 deletions src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
<import class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"/>
<import class="ch.qos.logback.core.ConsoleAppender"/>

<appender name="STDOUT" class="ConsoleAppender">
<encoder class="PatternLayoutEncoder">
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%kvp- %msg%n</pattern>
</encoder>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder"/>
</appender>

<root level="INFO">
Expand Down

0 comments on commit 68cb869

Please sign in to comment.