diff options
Diffstat (limited to 'pdf-over-gui/src/main/java/at')
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$ |