From 35a49499072791a9bcde30f7ddeaf5c712f3e3b4 Mon Sep 17 00:00:00 2001 From: Simon Ebner Date: Wed, 15 Jan 2014 13:38:03 +0100 Subject: [PATCH] Rest server now also takes ch.psi.fda.home variable into account FDA-106 --- ch.psi.fda/Readme.md | 3 +++ ch.psi.fda/src/main/java/ch/psi/fda/rest/FdaServer.java | 5 +++++ ch.psi.fda/src/test/resources/home/config/logging.properties | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ch.psi.fda/Readme.md b/ch.psi.fda/Readme.md index fa079a0..9193783 100644 --- a/ch.psi.fda/Readme.md +++ b/ch.psi.fda/Readme.md @@ -1,6 +1,9 @@ # Overview This package holds the core functionality of FDA. +# Usage +use -Djava.util.logging.config.file=logging.properties` to configure logging + # Development When checking out the project from the repository there is the `target/generated-sources/xjc` folder missing. After checking out the project execute `mvn compile` to create the folder and the required classes. diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/rest/FdaServer.java b/ch.psi.fda/src/main/java/ch/psi/fda/rest/FdaServer.java index 8100e9a..8811a2b 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/rest/FdaServer.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/rest/FdaServer.java @@ -18,6 +18,7 @@ import org.glassfish.jersey.jackson.JacksonFeature; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.grizzly.http.server.HttpServer; +import ch.psi.fda.install.ApplicationConfigurator; import sun.misc.Signal; import sun.misc.SignalHandler; @@ -51,6 +52,10 @@ public class FdaServer { return; } + // set the correct environment variable based on ch.psi.fda.home variable + ApplicationConfigurator ac = new ApplicationConfigurator(); + ac.initializeApplication(); + URI baseUri = UriBuilder.fromUri("http://" + hostname + "/").port(port).build(); ResourceBinder binder = new ResourceBinder(); diff --git a/ch.psi.fda/src/test/resources/home/config/logging.properties b/ch.psi.fda/src/test/resources/home/config/logging.properties index 575282f..3080de2 100644 --- a/ch.psi.fda/src/test/resources/home/config/logging.properties +++ b/ch.psi.fda/src/test/resources/home/config/logging.properties @@ -11,4 +11,4 @@ java.util.logging.ConsoleHandler.level=ALL java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter # Set the default logging level for the logger named com.mycompany -ch.psi.level=ALL +ch.psi.level=ALL \ No newline at end of file