Skip to content

Commit

Permalink
Clean up logging config
Browse files Browse the repository at this point in the history
  • Loading branch information
nck-mlcnv committed Jun 11, 2024
1 parent 151af88 commit 9b876b1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 62 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package org.aksw.iguana.cc.controller;

import ch.qos.logback.classic.Level;
import com.beust.jcommander.*;
import org.aksw.iguana.cc.suite.IguanaSuiteParser;
import org.aksw.iguana.cc.suite.Suite;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.net.URI;
import java.nio.file.Path;


Expand Down Expand Up @@ -46,11 +44,7 @@ public Path convert(String value) {
* @param argc The command line arguments that are passed to the program.
*/
public static void main(String[] argc) {
// Apparently, there is something weird going on, where the apache jena library already configures log4j2 for
// some reason. That's why you have to call reconfigure here.
// Configurator.reconfigure(URI.create("log4j2.yml"));
ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
root.setLevel(Level.INFO);

var args = new Args();
JCommander jc = JCommander.newBuilder()
Expand Down
56 changes: 0 additions & 56 deletions src/main/resources/log4j2.yml

This file was deleted.

27 changes: 27 additions & 0 deletions src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration>

<configuration>
<import class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"/>
<import class="ch.qos.logback.core.ConsoleAppender"/>
<import class="ch.qos.logback.core.FileAppender"/>

<appender name="STDOUT" class="ConsoleAppender">
<encoder class="PatternLayoutEncoder">
<pattern>%d{HH:mm:ss.SSS} %highlight(%-5level) [%thread] %logger{0} -- %msg%n</pattern>
</encoder>
</appender>

<appender name="FILE" class="FileAppender">
<file>iguana.log</file>
<append>true</append>
<encoder class="PatternLayoutEncoder">
<pattern>%d{HH:mm:ss.SSS} %-5level [%thread] %logger{0} -- %msg%n</pattern>
</encoder>
</appender>

<root level="INFO">
<appender-ref ref="FILE"/>
<appender-ref ref="STDOUT"/>
</root>
</configuration>

0 comments on commit 9b876b1

Please sign in to comment.