diff --git a/fr.sparna/rdf/skos/skos-play-cli/pom.xml b/fr.sparna/rdf/skos/skos-play-cli/pom.xml index a55b7dd9..e593c502 100644 --- a/fr.sparna/rdf/skos/skos-play-cli/pom.xml +++ b/fr.sparna/rdf/skos/skos-play-cli/pom.xml @@ -138,6 +138,16 @@ jcommander 1.30 + + + org.slf4j + slf4j-api + + + ch.qos.logback + logback-classic + 1.2.3 + diff --git a/fr.sparna/rdf/skos/skos-play-cli/src/main/java/fr/sparna/rdf/skos/printer/cli/Main.java b/fr.sparna/rdf/skos/skos-play-cli/src/main/java/fr/sparna/rdf/skos/printer/cli/Main.java index 76e984a0..df26a8be 100644 --- a/fr.sparna/rdf/skos/skos-play-cli/src/main/java/fr/sparna/rdf/skos/printer/cli/Main.java +++ b/fr.sparna/rdf/skos/skos-play-cli/src/main/java/fr/sparna/rdf/skos/printer/cli/Main.java @@ -1,12 +1,11 @@ package fr.sparna.rdf.skos.printer.cli; -import org.apache.log4j.PropertyConfigurator; -import org.apache.log4j.xml.DOMConfigurator; import com.beust.jcommander.JCommander; import com.beust.jcommander.MissingCommandException; import com.beust.jcommander.ParameterException; +import ch.qos.logback.classic.util.ContextInitializer; import fr.sparna.rdf.skos.printer.cli.alignment.Alignment; import fr.sparna.rdf.skos.printer.cli.alignment.ArgumentsAlignment; import fr.sparna.rdf.skos.printer.cli.alphabetical.Alphabetical; @@ -82,6 +81,14 @@ private void run(String[] args) throws Exception { System.exit(-1); } + // configure logging + if(main.getLog() != null) { + System.setProperty(ContextInitializer.CONFIG_FILE_PROPERTY, main.getLog().getAbsolutePath()); + + } + // explicitely quiet FOP + ((ch.qos.logback.classic.Logger) org.slf4j.LoggerFactory.getLogger("org.apache.fop")).setLevel(ch.qos.logback.classic.Level.INFO); + // if help was requested, print it and exit with a normal code if(main.isHelp()) { jc.usage(); @@ -96,17 +103,6 @@ private void run(String[] args) throws Exception { System.exit(-1); } - // configure logging using log4j - if(main.getLog() != null) { - if(main.getLog().getName().endsWith(".xml")) { - DOMConfigurator.configure(main.getLog().getAbsolutePath()); - } else { - PropertyConfigurator.configure(main.getLog().getAbsolutePath()); - } - } - // explicitely quiet FOP - org.apache.log4j.Logger.getLogger("org.apache.fop").setLevel(org.apache.log4j.Level.INFO); - // executes the command with the associated arguments COMMAND.valueOf(jc.getParsedCommand().toUpperCase()).getCommand().execute( COMMAND.valueOf(jc.getParsedCommand().toUpperCase()).getArguments() diff --git a/fr.sparna/rdf/skos/skos-play/pom.xml b/fr.sparna/rdf/skos/skos-play/pom.xml index 74c7f9bc..34a17a52 100644 --- a/fr.sparna/rdf/skos/skos-play/pom.xml +++ b/fr.sparna/rdf/skos/skos-play/pom.xml @@ -125,6 +125,7 @@ + @@ -149,7 +151,7 @@ com.google.oauth-client - google-oauth-client-jetty + google-oauth-client-servlet 1.22.0