Mercurial > dive4elements > http-client
diff src/main/java/org/dive4elements/artifacts/httpclient/ConsoleClient.java @ 124:7261c948425c 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:15:04 +0100 |
parents | 133281653904 |
children | e602a29f1dcc |
line wrap: on
line diff
--- a/src/main/java/org/dive4elements/artifacts/httpclient/ConsoleClient.java Mon Mar 22 12:41:23 2021 +0100 +++ b/src/main/java/org/dive4elements/artifacts/httpclient/ConsoleClient.java Fri Feb 25 15:15:04 2022 +0100 @@ -13,8 +13,6 @@ import java.io.FileOutputStream; import java.io.OutputStream; -import java.net.MalformedURLException; - import java.util.Arrays; import java.util.ArrayList; import java.util.HashMap; @@ -28,7 +26,6 @@ import org.w3c.dom.NodeList; import org.apache.log4j.Logger; -import org.apache.log4j.PropertyConfigurator; import org.dive4elements.artifacts.httpclient.http.HttpClient; import org.dive4elements.artifacts.httpclient.http.HttpClientImpl; @@ -48,13 +45,6 @@ public class ConsoleClient { /** - * 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"; - - - /** * The path of the configuration directory. */ public static final String CONFIG_PATH = System.getProperty("config.dir", @@ -69,32 +59,7 @@ /** * The logger used in this class. */ - private static Logger logger; - - - static { - configureLogging(); - - logger = Logger.getLogger(ConsoleClient.class); - } - - - /** - * Trys to load the Log4j configuration from ${config.dir}/log4j.properties. - */ - public static final void configureLogging() { - File configDir = new File(CONFIG_PATH); - File propFile = new File(configDir, LOG4J_PROPERTIES); - - if (propFile.isFile() && propFile.canRead()) { - try { - PropertyConfigurator.configure(propFile.toURI().toURL()); - } - catch (MalformedURLException mue) { - mue.printStackTrace(System.err); - } - } - } + private static Logger logger = Logger.getLogger(ConsoleClient.class); public static final Configuration readConfiguration() {