changeset 568:5cd1c627cda9 3.2.x

Rely on log4j's default initialization procedure This should make upgrading to Log4j 2.x easier. In passing, use latest Log4j 1.
author Tom Gottfried <tom@intevation.de>
date Fri, 25 Feb 2022 15:01:23 +0100
parents 48d14cf857db
children 2b40f4bf190d
files artifact-database/pom.xml artifact-database/src/main/java/org/dive4elements/artifactdatabase/App.java artifacts-common/pom.xml
diffstat 3 files changed, 2 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/artifact-database/pom.xml	Fri Feb 25 14:53:32 2022 +0100
+++ b/artifact-database/pom.xml	Fri Feb 25 15:01:23 2022 +0100
@@ -74,17 +74,7 @@
     <dependency>
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
-      <version>1.2.14</version>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>jul-to-slf4j</artifactId>
-      <version>1.6.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-log4j12</artifactId>
-      <version>1.6.1</version>
+      <version>1.2.17</version>
     </dependency>
     <dependency>
         <groupId>org.mortbay.jetty</groupId>
--- a/artifact-database/src/main/java/org/dive4elements/artifactdatabase/App.java	Fri Feb 25 14:53:32 2022 +0100
+++ b/artifact-database/src/main/java/org/dive4elements/artifactdatabase/App.java	Fri Feb 25 15:01:23 2022 +0100
@@ -8,17 +8,8 @@
 
 package org.dive4elements.artifactdatabase;
 
-import org.dive4elements.artifacts.common.utils.Config;
-
 import org.dive4elements.artifactdatabase.rest.HTTPServer;
 
-import java.io.File;
-
-import java.net.MalformedURLException;
-
-import org.apache.log4j.PropertyConfigurator;
-
-import org.slf4j.bridge.SLF4JBridgeHandler;
 
 /**
  * Starting point of the artifact database.
@@ -28,38 +19,11 @@
 public class App
 {
     /**
-     * The logging is done via Log4j. To configure the logging
-     * a file 'log4j.properties' is search in the configuration directory.
-     */
-    public static final String LOG4J_PROPERTIES =
-        "log4j.properties";
-
-    /**
-     * Trys to load the Log4j configuration from ${config.dir}/log4j.properties.
-     */
-    public static final void configureLogging() {
-        File configDir = Config.getConfigDirectory();
-        File propFile = new File(configDir, LOG4J_PROPERTIES);
-
-        if (propFile.isFile() && propFile.canRead()) {
-            try {
-                PropertyConfigurator.configure(propFile.toURI().toURL());
-                SLF4JBridgeHandler.install();
-            }
-            catch (MalformedURLException mue) {
-                mue.printStackTrace(System.err);
-            }
-        }
-    }
-
-    /**
      * Starts the artifact database.
      * @param args The commandline arguments. Unused.
      */
     public static void main(String[] args) {
 
-        configureLogging();
-
         FactoryBootstrap bootstrap = new FactoryBootstrap();
 
         bootstrap.boot();
--- a/artifacts-common/pom.xml	Fri Feb 25 14:53:32 2022 +0100
+++ b/artifacts-common/pom.xml	Fri Feb 25 15:01:23 2022 +0100
@@ -24,7 +24,7 @@
     <dependency>
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
-      <version>1.2.14</version>
+      <version>1.2.17</version>
     </dependency>
     <dependency>
       <groupId>commons-codec</groupId>

http://dive4elements.wald.intevation.org