Browse Source

Fixed log configuration.

master
Christian P. MOMON 2 years ago
parent
commit
a7d1f43f28
  1. 3
      src/org/april/agirstatool/AgirStatoolLauncher.java
  2. 14
      src/org/april/agirstatool/cli/AgiStatoolCLI.java

3
src/org/april/agirstatool/AgirStatoolLauncher.java

@ -21,6 +21,7 @@ package org.april.agirstatool;
import java.io.File;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.PropertyConfigurator;
import org.april.agirstatool.cli.AgiStatoolCLI;
import org.april.agirstatool.demo.AgirStatool;
@ -59,7 +60,7 @@ public final class AgirStatoolLauncher
}
else
{
// BasicConfigurator.configure();
BasicConfigurator.configure();
// logger.info("Basic log configuration done.");
// logger.info("Configuration file was not found in [{}].",
// loggerConfig.getAbsoluteFile());

14
src/org/april/agirstatool/cli/AgiStatoolCLI.java

@ -86,8 +86,9 @@ public final class AgiStatoolCLI
else
{
BasicConfigurator.configure();
logger.info("Basic log configuration done.");
logger.info("Configuration file was not found in [{}].", loggerConfig.getAbsoluteFile());
// logger.info("Basic log configuration done.");
// logger.info("Configuration file was not found in [{}].",
// loggerConfig.getAbsoluteFile());
}
// Run.
@ -175,9 +176,12 @@ public final class AgiStatoolCLI
{
// Apply -c parameter.
File log4jfile = new File(configurationFile.getParentFile(), "log4j.properties");
logger.info("Applying configuration file found in [{}].", log4jfile.getAbsoluteFile());
PropertyConfigurator.configure(log4jfile.getAbsolutePath());
logger.info("Configuration log configuration done.");
if (log4jfile.exists())
{
logger.info("Applying configuration file found in [{}].", log4jfile.getAbsoluteFile());
PropertyConfigurator.configure(log4jfile.getAbsolutePath());
logger.info("Configuration log configuration done.");
}
switch (command)
{

Loading…
Cancel
Save