From a3d0dab1f60a3dec2cfb0a147e4ee29e106a2c33 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Wed, 2 Apr 2014 13:01:00 +0200 Subject: use Log4j for logging --- .../moa/id/configuration/data/oa/OASTORKConfig.java | 8 ++++++-- .../moa/id/configuration/helper/LanguageHelper.java | 13 ++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'id/ConfigWebTool/src') diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java index b99a7d5c0..03d2d6d1e 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java @@ -25,6 +25,8 @@ package at.gv.egovernment.moa.id.configuration.data.oa; import java.util.ArrayList; import java.util.List; +import org.apache.log4j.Logger; + import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; import at.gv.egovernment.moa.id.commons.db.dao.config.AttributeProviderPlugin; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentOA; @@ -33,11 +35,13 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.OASTORK; import at.gv.egovernment.moa.id.commons.db.dao.config.OAStorkAttribute; import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; import at.gv.egovernment.moa.id.commons.db.dao.config.StorkAttribute; -import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.id.configuration.helper.MailHelper; import at.gv.egovernment.moa.id.protocols.stork2.AttributeProviderFactory; public class OASTORKConfig { + private static final Logger log = Logger.getLogger(OASTORKConfig.class); + private boolean isStorkLogonEnabled = false; private int qaa; @@ -113,7 +117,7 @@ public class OASTORKConfig { if (attributeProviderPlugins.isEmpty()) attributeProviderPlugins.add(new AttributeProviderPlugin()); } catch (NullPointerException ex) { - Logger.error("Nullpointerexception encountered in Configurationinterface"); + log.error("Nullpointerexception encountered in Configurationinterface", ex); } } } diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/LanguageHelper.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/LanguageHelper.java index 62ba92539..0a74e8c54 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/LanguageHelper.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/LanguageHelper.java @@ -25,7 +25,6 @@ package at.gv.egovernment.moa.id.configuration.helper; import at.gv.egovernment.moa.id.configuration.config.ConfigurationProvider; import at.gv.egovernment.moa.id.configuration.exception.ConfigurationException; -import at.gv.egovernment.moa.logging.Logger; import java.text.MessageFormat; import java.util.Locale; @@ -33,9 +32,13 @@ import java.util.ResourceBundle; import javax.servlet.http.HttpServletRequest; +import org.apache.log4j.Logger; + public class LanguageHelper { + private static final Logger log = Logger.getLogger(LanguageHelper.class); + private static ResourceBundle errorRes_DE = ResourceBundle.getBundle("applicationResources", Locale.GERMAN); private static ResourceBundle guiRes_DE = ResourceBundle.getBundle("applicationResources", Locale.GERMAN); @@ -43,7 +46,6 @@ public class LanguageHelper { private static ResourceBundle guiRes_EN = ResourceBundle.getBundle("applicationResources_en", Locale.ENGLISH); private static ResourceBundle errorLanguage() { - Logger.setHierarchy("moa.id.configuration"); try { ConfigurationProvider configurationProvider = ConfigurationProvider.getInstance(); if (configurationProvider.getDefaultLanguage().equals("en")) { @@ -52,14 +54,12 @@ public class LanguageHelper { return errorRes_DE; } } catch (ConfigurationException e) { - Logger.error("Configuration exception while getting ConfigurationProvider instance"); - e.printStackTrace(); + log.error("Configuration exception while getting ConfigurationProvider instance", e); return errorRes_DE; } } private static ResourceBundle guiLanguage() { - Logger.setHierarchy("moa.id.configuration"); try { ConfigurationProvider configurationProvider = ConfigurationProvider.getInstance(); if (configurationProvider.getDefaultLanguage().equals("en")) { @@ -68,8 +68,7 @@ public class LanguageHelper { return guiRes_DE; } } catch (ConfigurationException e) { - Logger.error("Configuration exception while getting ConfigurationProvider instance"); - e.printStackTrace(); + log.error("Configuration exception while getting ConfigurationProvider instance", e); return guiRes_DE; } } -- cgit v1.2.3