diff artifact-database/src/main/java/org/dive4elements/artifactdatabase/App.java @ 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 3b1e48d22ce0
children
line wrap: on
line diff
--- 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();

http://dive4elements.wald.intevation.org