From 22e79573101d3c2eed1c53a3a03013630e2c793c Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Thu, 23 Jan 2020 09:42:21 +0100 Subject: [PATCH] Fix default log configuration. --- src/org/april/agirstatool/AgirStatoolLauncher.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/org/april/agirstatool/AgirStatoolLauncher.java b/src/org/april/agirstatool/AgirStatoolLauncher.java index dba642f..462afad 100644 --- a/src/org/april/agirstatool/AgirStatoolLauncher.java +++ b/src/org/april/agirstatool/AgirStatoolLauncher.java @@ -22,6 +22,8 @@ import java.io.File; import org.apache.commons.lang3.ArrayUtils; import org.apache.log4j.BasicConfigurator; +import org.apache.log4j.ConsoleAppender; +import org.apache.log4j.EnhancedPatternLayout; import org.apache.log4j.PropertyConfigurator; import org.april.agirstatool.cli.AgiStatoolCLI; import org.april.agirstatool.demo.AgirStatool; @@ -51,7 +53,7 @@ public final class AgirStatoolLauncher public static void main(final String[] args) { // Configure log. - File loggerConfig = new File("log4j.properties"); + File loggerConfig = new File("log4j.peroperties"); if (loggerConfig.exists()) { PropertyConfigurator.configure(loggerConfig.getAbsolutePath()); @@ -60,7 +62,7 @@ public final class AgirStatoolLauncher } else { - BasicConfigurator.configure(); + BasicConfigurator.configure(new ConsoleAppender(new EnhancedPatternLayout("%m%n"))); // logger.info("Basic log configuration done."); // logger.info("Configuration file was not found in [{}].", // loggerConfig.getAbsoluteFile());