diff options
author | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-04-10 19:28:47 +0000 |
---|---|---|
committer | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-04-10 19:28:47 +0000 |
commit | 01ddb2a36c61d3d41608c714cba04bc981895db4 (patch) | |
tree | 644ee0939ac9fb5628964ca9f4fcbd65dcae7074 /pdf-over-gui/src/main/java | |
parent | 47c8c6b377fe51ee60cdad518946613a262792cf (diff) | |
download | pdf-over-01ddb2a36c61d3d41608c714cba04bc981895db4.tar.gz pdf-over-01ddb2a36c61d3d41608c714cba04bc981895db4.tar.bz2 pdf-over-01ddb2a36c61d3d41608c714cba04bc981895db4.zip |
load log4j props after creating, watch for changes
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@342 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui/src/main/java')
3 files changed, 8 insertions, 4 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/DeveloperMain.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/DeveloperMain.java index d2c1b42c..79e45028 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/DeveloperMain.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/DeveloperMain.java @@ -52,7 +52,7 @@ public class DeveloperMain { File log4j = new File(configDir.getAbsolutePath() + File.separator + Constants.DEFAULT_LOG4J_FILENAME); if(log4j.exists()) { - PropertyConfigurator.configure(log4j.getAbsolutePath()); + PropertyConfigurator.configureAndWatch(log4j.getAbsolutePath()); } StringBuilder sb = new StringBuilder(); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Main.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Main.java index 4ff52ae7..03b0bfeb 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Main.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Main.java @@ -61,7 +61,7 @@ public class Main { File log4j = new File(configDir.getAbsolutePath() + File.separator + Constants.DEFAULT_LOG4J_FILENAME); if(log4j.exists()) { - PropertyConfigurator.configure(log4j.getAbsolutePath()); + PropertyConfigurator.configureAndWatch(log4j.getAbsolutePath()); } StateMachineImpl stateMachine = new StateMachineImpl(args); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java index 3a9048ba..a05ded9e 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java @@ -23,6 +23,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import org.apache.log4j.PropertyConfigurator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -190,12 +191,15 @@ public class PrepareConfigurationState extends State { try { inputStream = this.getClass().getResourceAsStream( RES_PATH + Constants.DEFAULT_LOG4J_FILENAME); - pdfOverConfig = new FileOutputStream(this.stateMachine.getConfigProvider().getConfigurationDirectory() - + FILE_SEPARATOR + Constants.DEFAULT_LOG4J_FILENAME); + String filename = this.stateMachine.getConfigProvider().getConfigurationDirectory() + + FILE_SEPARATOR + Constants.DEFAULT_LOG4J_FILENAME; + pdfOverConfig = new FileOutputStream(filename); while ((byteCount = inputStream.read(buffer)) >= 0) { pdfOverConfig.write(buffer, 0, byteCount); } + + PropertyConfigurator.configureAndWatch(filename); } catch (Exception e) { log.error( "Failed to write log4j config file to config directory", e); //$NON-NLS-1$ |