Skip to content

Commit

Permalink
feat(core): add Elastic Common Schema (ecs) log format dependencies
Browse files Browse the repository at this point in the history
close #2611
  • Loading branch information
tchiotludo committed Nov 29, 2023
1 parent 701dd17 commit c7598f6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dependencies {
implementation group: 'net.jodah', name: 'failsafe', version: '2.4.4'
implementation 'com.github.oshi:oshi-core:6.4.6'
implementation 'io.pebbletemplates:pebble:3.2.1'
implementation group: 'co.elastic.logging', name: 'logback-ecs-encoder', version: '1.5.0'

// scheduler
implementation group: 'com.cronutils', name: 'cron-utils', version: '9.2.1'
Expand Down
25 changes: 25 additions & 0 deletions core/src/main/resources/logback/ecs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<included>
<appender name="CONSOLE_ECS_OUT" class="ch.qos.logback.core.ConsoleAppender">
<target>System.out</target>
<immediateFlush>true</immediateFlush>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>DENY</onMatch>
</filter>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>WARN</level>
<onMatch>DENY</onMatch>
</filter>
<encoder class="co.elastic.logging.logback.EcsEncoder" />
</appender>

<appender name="CONSOLE_ECS_ERR" class="ch.qos.logback.core.ConsoleAppender">
<target>System.err</target>
<immediateFlush>true</immediateFlush>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
</filter>
<encoder class="co.elastic.logging.logback.EcsEncoder" />
</appender>
</included>

0 comments on commit c7598f6

Please sign in to comment.