From 0a24f8c56cb0f156bd548883a5e3b53cfc149ce2 Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 19:28:34 +0000 Subject: Move log4j props and config to avoid name clashes git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@340 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../workflow/states/PrepareConfigurationState.java | 15 +++++----- pdf-over-gui/src/main/resources/PDFOver.config | 1 - .../resources/at/asit/pdfover/gui/PDFOver.config | 1 + .../resources/at/asit/pdfover/gui/log4j.properties | 32 ++++++++++++++++++++++ pdf-over-gui/src/main/resources/log4j.properties | 32 ---------------------- 5 files changed, 41 insertions(+), 40 deletions(-) delete mode 100644 pdf-over-gui/src/main/resources/PDFOver.config create mode 100644 pdf-over-gui/src/main/resources/at/asit/pdfover/gui/PDFOver.config create mode 100644 pdf-over-gui/src/main/resources/at/asit/pdfover/gui/log4j.properties delete mode 100644 pdf-over-gui/src/main/resources/log4j.properties 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 955d125a..3a9048ba 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 @@ -57,7 +57,7 @@ public class PrepareConfigurationState extends State { private static final Logger log = LoggerFactory .getLogger(PrepareConfigurationState.class); - private static String RES_SEPARATOR = "/"; //$NON-NLS-1$ + private static String RES_PATH = "/at/asit/pdfover/gui/"; //$NON-NLS-1$ private static String FILE_SEPARATOR = File.separator; @@ -104,7 +104,7 @@ public class PrepareConfigurationState extends State { // default value! try { InputStream is = this.getClass().getResourceAsStream( - RES_SEPARATOR + filename); + RES_PATH + filename); this.stateMachine.getConfigProvider() .loadConfiguration(is); @@ -150,10 +150,11 @@ public class PrepareConfigurationState extends State { InputStream inputStream = null; FileOutputStream pdfOverConfig = null; try { - inputStream = this.getClass().getResourceAsStream( - RES_SEPARATOR + Constants.DEFAULT_CONFIG_FILENAME); - pdfOverConfig = new FileOutputStream(this.stateMachine.getConfigProvider().getConfigurationDirectory() - + FILE_SEPARATOR + Constants.DEFAULT_CONFIG_FILENAME); + inputStream = this.getClass().getResourceAsStream(RES_PATH + + Constants.DEFAULT_CONFIG_FILENAME); + pdfOverConfig = new FileOutputStream( + this.stateMachine.getConfigProvider().getConfigurationDirectory() + + FILE_SEPARATOR + Constants.DEFAULT_CONFIG_FILENAME); while ((byteCount = inputStream.read(buffer)) >= 0) { pdfOverConfig.write(buffer, 0, byteCount); @@ -188,7 +189,7 @@ public class PrepareConfigurationState extends State { pdfOverConfig = null; try { inputStream = this.getClass().getResourceAsStream( - RES_SEPARATOR + Constants.DEFAULT_LOG4J_FILENAME); + RES_PATH + Constants.DEFAULT_LOG4J_FILENAME); pdfOverConfig = new FileOutputStream(this.stateMachine.getConfigProvider().getConfigurationDirectory() + FILE_SEPARATOR + Constants.DEFAULT_LOG4J_FILENAME); diff --git a/pdf-over-gui/src/main/resources/PDFOver.config b/pdf-over-gui/src/main/resources/PDFOver.config deleted file mode 100644 index 85cc43ad..00000000 --- a/pdf-over-gui/src/main/resources/PDFOver.config +++ /dev/null @@ -1 +0,0 @@ -// Default configuration.... \ No newline at end of file diff --git a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/PDFOver.config b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/PDFOver.config new file mode 100644 index 00000000..85cc43ad --- /dev/null +++ b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/PDFOver.config @@ -0,0 +1 @@ +// Default configuration.... \ No newline at end of file diff --git a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/log4j.properties b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/log4j.properties new file mode 100644 index 00000000..74a980b2 --- /dev/null +++ b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/log4j.properties @@ -0,0 +1,32 @@ +log4j.rootLogger=TRACE, STDOUT, LOGFILE + +# STDOUT appender +log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender +log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout +log4j.appender.STDOUT.layout.ConversionPattern=%-5p | %d | %t | %c %x- %m%n + +log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender +log4j.appender.LOGFILE.file=${user.home}/.pdfover/pdfover.log +log4j.appender.LOGFILE.MaxFileSize=100KB +log4j.appender.LOGFILE.MaxBackupIndex=10 +log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout +log4j.appender.LOGFILE.layout.ConversionPattern=%-5p | %d | %t | %c %x- %m%n + +log4j.logger = INFO + +# DETAIL LEVELS PDF-Over +log4j.logger.at.asit.pdfover = DEBUG +log4j.logger.at.gv.egiz.pdfas = INFO +log4j.logger.at.knowcenter = INFO +log4j.logger.at.knowcenter.wag.egov.egiz.ldap = DEBUG +log4j.logger.org.apache.commons.httpclient = ERROR +log4j.logger.httpclient.wire = ERROR + + +# DETAIL LEVELS PDF-AS +log4j.logger.org.pdfbox = DEBUG +log4j.logger.org.apache.pdfbox.util = DEBUG +log4j.logger.at.gv.egiz.pdfas = DEBUG +log4j.logger.at.knowcenter = DEBUG +log4j.logger.at.knowcenter.wag.egov.egiz.ldap = DEBUG +log4j.logger.org.apache.commons.httpclient = ERROR \ No newline at end of file diff --git a/pdf-over-gui/src/main/resources/log4j.properties b/pdf-over-gui/src/main/resources/log4j.properties deleted file mode 100644 index 74a980b2..00000000 --- a/pdf-over-gui/src/main/resources/log4j.properties +++ /dev/null @@ -1,32 +0,0 @@ -log4j.rootLogger=TRACE, STDOUT, LOGFILE - -# STDOUT appender -log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender -log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout -log4j.appender.STDOUT.layout.ConversionPattern=%-5p | %d | %t | %c %x- %m%n - -log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender -log4j.appender.LOGFILE.file=${user.home}/.pdfover/pdfover.log -log4j.appender.LOGFILE.MaxFileSize=100KB -log4j.appender.LOGFILE.MaxBackupIndex=10 -log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout -log4j.appender.LOGFILE.layout.ConversionPattern=%-5p | %d | %t | %c %x- %m%n - -log4j.logger = INFO - -# DETAIL LEVELS PDF-Over -log4j.logger.at.asit.pdfover = DEBUG -log4j.logger.at.gv.egiz.pdfas = INFO -log4j.logger.at.knowcenter = INFO -log4j.logger.at.knowcenter.wag.egov.egiz.ldap = DEBUG -log4j.logger.org.apache.commons.httpclient = ERROR -log4j.logger.httpclient.wire = ERROR - - -# DETAIL LEVELS PDF-AS -log4j.logger.org.pdfbox = DEBUG -log4j.logger.org.apache.pdfbox.util = DEBUG -log4j.logger.at.gv.egiz.pdfas = DEBUG -log4j.logger.at.knowcenter = DEBUG -log4j.logger.at.knowcenter.wag.egov.egiz.ldap = DEBUG -log4j.logger.org.apache.commons.httpclient = ERROR \ No newline at end of file -- cgit v1.2.3