From 833708b48ea76e71ddf1fa9b0cba53a5aa23a459 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Tue, 27 Jun 2017 18:44:16 +0200 Subject: Fixed error message on invalid log type. To help troubleshooting the error message on invalid log type has been modified to include the invalid value. https://pagure.io/dogtagpki/issue/2689 Change-Id: Ie245bd9e3a3925979af4708fa911697a9746e54b --- base/server/cms/src/com/netscape/cms/logging/LogFile.java | 3 +-- base/server/cmsbundle/src/UserMessages.properties | 2 +- .../cmscore/src/com/netscape/cmscore/logging/LogSubsystem.java | 9 ++++----- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/base/server/cms/src/com/netscape/cms/logging/LogFile.java b/base/server/cms/src/com/netscape/cms/logging/LogFile.java index 1b4aeee0d..8a65160f0 100644 --- a/base/server/cms/src/com/netscape/cms/logging/LogFile.java +++ b/base/server/cms/src/com/netscape/cms/logging/LogFile.java @@ -511,9 +511,8 @@ public class LogFile implements ILogEventListener, IExtendedPluginInfo { } else if (mType.equals(ILogger.PROP_AUDIT)) { defaultFileName = "logs/transactions"; } else { - //wont get here throw new ELogException(CMS.getUserMessage("CMS_LOG_INVALID_LOG_TYPE", - config.getName())); + config.getName(), mType)); } try { diff --git a/base/server/cmsbundle/src/UserMessages.properties b/base/server/cmsbundle/src/UserMessages.properties index ed2a6205d..8ff07d894 100644 --- a/base/server/cmsbundle/src/UserMessages.properties +++ b/base/server/cmsbundle/src/UserMessages.properties @@ -505,7 +505,7 @@ CMS_LOG_INVALID_FILE_NAME=Attempt to initialize log with an invalid filename: \" CMS_LOG_UNEXPECTED_EXCEPTION=Caught unexpected exception: {0} CMS_LOG_ILLEGALARGUMENT=Illegal argument when opening: {0} CMS_LOG_CLOSE_FAILED=Failed to close file \"{0}\", error: {1} -CMS_LOG_INVALID_LOG_TYPE=Attempt to initialize log with an invalid log type: \"{0}\" +CMS_LOG_INVALID_LOG_TYPE=Invalid log type in \"{0}\" property: {1} CMS_LOG_SRVLT_ILL_PLUGIN_ID=Another plugin ID already exists {0} CMS_LOG_SRVLT_NULL_CLASS=Plugin classname is null CMS_LOG_SRVLT_NO_CLASS=Plugin class not found diff --git a/base/server/cmscore/src/com/netscape/cmscore/logging/LogSubsystem.java b/base/server/cmscore/src/com/netscape/cmscore/logging/LogSubsystem.java index ba405c2cd..e09e1c2ea 100644 --- a/base/server/cmscore/src/com/netscape/cmscore/logging/LogSubsystem.java +++ b/base/server/cmscore/src/com/netscape/cmscore/logging/LogSubsystem.java @@ -127,18 +127,17 @@ public class LogSubsystem implements ILogSubsystem { // for view from console } catch (ClassNotFoundException e) { - throw new EBaseException(insName + ":Failed to instantiate class " + className); + throw new EBaseException(insName + ": Failed to instantiate class " + className + ": " + e.getMessage(), e); } catch (IllegalAccessException e) { - throw new EBaseException(insName + ":Failed to instantiate class " + className); + throw new EBaseException(insName + ": Failed to instantiate class " + className + ": " + e.getMessage(), e); } catch (InstantiationException e) { - throw new EBaseException(insName + ":Failed to instantiate class " + className); + throw new EBaseException(insName + ": Failed to instantiate class " + className + ": " + e.getMessage(), e); } catch (Throwable e) { - e.printStackTrace(); throw new EBaseException(insName - + ":Failed to instantiate class " + className + " error: " + e.getMessage()); + + ": Failed to instantiate class " + className + " error: " + e.getMessage(), e); } if (insName == null) { -- cgit