Browse Source

lambda all the logging

Jason Rivard 5 years ago
parent
commit
a2d8984191
100 changed files with 316 additions and 317 deletions
  1. 23 23
      server/src/main/java/password/pwm/PwmApplication.java
  2. 8 8
      server/src/main/java/password/pwm/PwmEnvironment.java
  3. 8 8
      server/src/main/java/password/pwm/config/Configuration.java
  4. 2 2
      server/src/main/java/password/pwm/config/PwmSetting.java
  5. 1 1
      server/src/main/java/password/pwm/config/function/UserMatchViewerFunction.java
  6. 1 1
      server/src/main/java/password/pwm/config/profile/LdapProfile.java
  7. 1 1
      server/src/main/java/password/pwm/config/profile/PwmPasswordPolicy.java
  8. 1 1
      server/src/main/java/password/pwm/config/profile/PwmPasswordRule.java
  9. 3 3
      server/src/main/java/password/pwm/config/stored/ConfigurationReader.java
  10. 2 2
      server/src/main/java/password/pwm/config/stored/StoredConfigurationFactory.java
  11. 1 1
      server/src/main/java/password/pwm/config/stored/StoredConfigurationImpl.java
  12. 1 1
      server/src/main/java/password/pwm/config/stored/StoredConfigurationUtil.java
  13. 2 2
      server/src/main/java/password/pwm/config/value/ActionValue.java
  14. 2 2
      server/src/main/java/password/pwm/config/value/FileValue.java
  15. 3 3
      server/src/main/java/password/pwm/config/value/PrivateKeyValue.java
  16. 1 1
      server/src/main/java/password/pwm/config/value/RemoteWebServiceValue.java
  17. 2 2
      server/src/main/java/password/pwm/config/value/StoredValueEncoder.java
  18. 2 2
      server/src/main/java/password/pwm/config/value/ValueFactory.java
  19. 3 3
      server/src/main/java/password/pwm/config/value/X509CertificateValue.java
  20. 2 2
      server/src/main/java/password/pwm/config/value/data/ShortcutItem.java
  21. 1 1
      server/src/main/java/password/pwm/health/ApplianceStatusChecker.java
  22. 1 1
      server/src/main/java/password/pwm/health/CertificateChecker.java
  23. 3 3
      server/src/main/java/password/pwm/health/ConfigurationChecker.java
  24. 1 1
      server/src/main/java/password/pwm/health/DatabaseStatusChecker.java
  25. 3 3
      server/src/main/java/password/pwm/health/HealthMonitor.java
  26. 9 9
      server/src/main/java/password/pwm/health/LDAPHealthChecker.java
  27. 7 7
      server/src/main/java/password/pwm/http/ContextManager.java
  28. 8 8
      server/src/main/java/password/pwm/http/HttpEventManager.java
  29. 1 1
      server/src/main/java/password/pwm/http/IdleTimeoutCalculator.java
  30. 5 5
      server/src/main/java/password/pwm/http/JspUtility.java
  31. 1 1
      server/src/main/java/password/pwm/http/PwmHttpRequestWrapper.java
  32. 2 2
      server/src/main/java/password/pwm/http/PwmHttpResponseWrapper.java
  33. 3 3
      server/src/main/java/password/pwm/http/PwmRequest.java
  34. 3 3
      server/src/main/java/password/pwm/http/PwmResponse.java
  35. 2 2
      server/src/main/java/password/pwm/http/PwmSession.java
  36. 1 1
      server/src/main/java/password/pwm/http/PwmURL.java
  37. 1 1
      server/src/main/java/password/pwm/http/SessionManager.java
  38. 9 9
      server/src/main/java/password/pwm/http/auth/CASFilterAuthenticationProvider.java
  39. 1 1
      server/src/main/java/password/pwm/http/auth/HttpAuthenticationUtilities.java
  40. 2 7
      server/src/main/java/password/pwm/http/bean/SetupOtpBean.java
  41. 3 3
      server/src/main/java/password/pwm/http/filter/AbstractPwmFilter.java
  42. 1 1
      server/src/main/java/password/pwm/http/filter/ApplicationModeFilter.java
  43. 1 1
      server/src/main/java/password/pwm/http/filter/AuthenticationFilter.java
  44. 2 2
      server/src/main/java/password/pwm/http/filter/AuthorizationFilter.java
  45. 2 2
      server/src/main/java/password/pwm/http/filter/GZIPFilter.java
  46. 9 9
      server/src/main/java/password/pwm/http/filter/RequestInitializationFilter.java
  47. 4 4
      server/src/main/java/password/pwm/http/filter/SessionFilter.java
  48. 8 8
      server/src/main/java/password/pwm/http/servlet/AbstractPwmServlet.java
  49. 3 3
      server/src/main/java/password/pwm/http/servlet/ClientApiServlet.java
  50. 6 6
      server/src/main/java/password/pwm/http/servlet/ControlledPwmServlet.java
  51. 2 2
      server/src/main/java/password/pwm/http/servlet/DeleteAccountServlet.java
  52. 4 4
      server/src/main/java/password/pwm/http/servlet/GuestRegistrationServlet.java
  53. 7 7
      server/src/main/java/password/pwm/http/servlet/SetupOtpServlet.java
  54. 1 1
      server/src/main/java/password/pwm/http/servlet/ShortcutServlet.java
  55. 1 1
      server/src/main/java/password/pwm/http/servlet/accountinfo/AccountInformationServlet.java
  56. 2 2
      server/src/main/java/password/pwm/http/servlet/activation/ActivateUserUtils.java
  57. 1 1
      server/src/main/java/password/pwm/http/servlet/admin/AppDashboardData.java
  58. 1 1
      server/src/main/java/password/pwm/http/servlet/changepw/ChangePasswordServlet.java
  59. 1 1
      server/src/main/java/password/pwm/http/servlet/changepw/ChangePasswordServletUtil.java
  60. 1 1
      server/src/main/java/password/pwm/http/servlet/command/CommandServlet.java
  61. 5 5
      server/src/main/java/password/pwm/http/servlet/configeditor/ConfigEditorServlet.java
  62. 3 3
      server/src/main/java/password/pwm/http/servlet/configeditor/ConfigEditorServletUtils.java
  63. 1 1
      server/src/main/java/password/pwm/http/servlet/configguide/ConfigGuideForm.java
  64. 8 8
      server/src/main/java/password/pwm/http/servlet/configguide/ConfigGuideServlet.java
  65. 3 3
      server/src/main/java/password/pwm/http/servlet/configguide/ConfigGuideUtils.java
  66. 1 1
      server/src/main/java/password/pwm/http/servlet/configguide/GuideStep.java
  67. 1 1
      server/src/main/java/password/pwm/http/servlet/configmanager/ConfigManagerCertificatesServlet.java
  68. 4 4
      server/src/main/java/password/pwm/http/servlet/configmanager/ConfigManagerLocalDBServlet.java
  69. 1 1
      server/src/main/java/password/pwm/http/servlet/configmanager/ConfigManagerLoginServlet.java
  70. 3 3
      server/src/main/java/password/pwm/http/servlet/configmanager/ConfigManagerServlet.java
  71. 4 4
      server/src/main/java/password/pwm/http/servlet/configmanager/ConfigManagerWordlistServlet.java
  72. 4 4
      server/src/main/java/password/pwm/http/servlet/configmanager/DebugItemGenerator.java
  73. 5 5
      server/src/main/java/password/pwm/http/servlet/forgottenpw/ForgottenPasswordServlet.java
  74. 1 1
      server/src/main/java/password/pwm/http/servlet/forgottenpw/ForgottenPasswordStateMachine.java
  75. 4 4
      server/src/main/java/password/pwm/http/servlet/forgottenpw/ForgottenPasswordUtil.java
  76. 1 1
      server/src/main/java/password/pwm/http/servlet/helpdesk/HelpdeskDetailInfoBean.java
  77. 7 7
      server/src/main/java/password/pwm/http/servlet/helpdesk/HelpdeskServlet.java
  78. 3 3
      server/src/main/java/password/pwm/http/servlet/newuser/NewUserServlet.java
  79. 7 5
      server/src/main/java/password/pwm/http/servlet/newuser/NewUserUtils.java
  80. 10 10
      server/src/main/java/password/pwm/http/servlet/oauth/OAuthConsumerServlet.java
  81. 2 2
      server/src/main/java/password/pwm/http/servlet/oauth/OAuthMachine.java
  82. 5 5
      server/src/main/java/password/pwm/http/servlet/peoplesearch/PeopleSearchDataReader.java
  83. 1 1
      server/src/main/java/password/pwm/http/servlet/peoplesearch/PeopleSearchServlet.java
  84. 5 3
      server/src/main/java/password/pwm/http/servlet/resource/ResourceFileRequest.java
  85. 4 4
      server/src/main/java/password/pwm/http/servlet/resource/ResourceFileServlet.java
  86. 3 3
      server/src/main/java/password/pwm/http/servlet/resource/ResourceServletConfiguration.java
  87. 4 4
      server/src/main/java/password/pwm/http/servlet/resource/ResourceServletService.java
  88. 4 4
      server/src/main/java/password/pwm/http/servlet/updateprofile/UpdateProfileServlet.java
  89. 1 1
      server/src/main/java/password/pwm/http/state/CryptoCookieBeanImpl.java
  90. 1 1
      server/src/main/java/password/pwm/http/state/LocalSessionBeanImpl.java
  91. 1 1
      server/src/main/java/password/pwm/http/state/SessionStateService.java
  92. 1 1
      server/src/main/java/password/pwm/http/tag/CurrentUrlTag.java
  93. 1 1
      server/src/main/java/password/pwm/http/tag/ErrorMessageTag.java
  94. 3 3
      server/src/main/java/password/pwm/http/tag/JspThrowableHandlerTag.java
  95. 3 3
      server/src/main/java/password/pwm/http/tag/PasswordRequirementsTag.java
  96. 1 1
      server/src/main/java/password/pwm/http/tag/PwmFormIDTag.java
  97. 1 1
      server/src/main/java/password/pwm/http/tag/PwmMacroTag.java
  98. 1 1
      server/src/main/java/password/pwm/http/tag/PwmScriptRefTag.java
  99. 2 2
      server/src/main/java/password/pwm/http/tag/PwmScriptTag.java
  100. 3 3
      server/src/main/java/password/pwm/http/tag/conditional/PwmIfTag.java

+ 23 - 23
server/src/main/java/password/pwm/PwmApplication.java

@@ -181,7 +181,7 @@ public class PwmApplication
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.fatal( e.getMessage() );
+            LOGGER.fatal( () -> e.getMessage() );
             throw e;
             throw e;
         }
         }
     }
     }
@@ -221,7 +221,7 @@ public class PwmApplication
                     break;
                     break;
 
 
                 case ERROR:
                 case ERROR:
-                    LOGGER.fatal( "starting up in ERROR mode! Check log or health check information for cause" );
+                    LOGGER.fatal( () -> "starting up in ERROR mode! Check log or health check information for cause" );
                     break;
                     break;
 
 
                 default:
                 default:
@@ -261,7 +261,7 @@ public class PwmApplication
         {
         {
             if ( getApplicationMode() == PwmApplicationMode.ERROR || getApplicationMode() == PwmApplicationMode.NEW )
             if ( getApplicationMode() == PwmApplicationMode.ERROR || getApplicationMode() == PwmApplicationMode.NEW )
             {
             {
-                LOGGER.warn( "skipping LocalDB open due to application mode " + getApplicationMode() );
+                LOGGER.warn( () -> "skipping LocalDB open due to application mode " + getApplicationMode() );
             }
             }
             else
             else
             {
             {
@@ -313,7 +313,7 @@ public class PwmApplication
         }
         }
         catch ( final PwmException e )
         catch ( final PwmException e )
         {
         {
-            LOGGER.error( "error outputting log to debug: " + e.getMessage() );
+            LOGGER.error( () -> "error outputting log to debug: " + e.getMessage() );
         }
         }
 
 
 
 
@@ -346,7 +346,7 @@ public class PwmApplication
         }
         }
         catch ( final PwmException e )
         catch ( final PwmException e )
         {
         {
-            LOGGER.warn( "unable to submit start alert event " + e.getMessage() );
+            LOGGER.warn( () -> "unable to submit start alert event " + e.getMessage() );
         }
         }
 
 
         try
         try
@@ -356,7 +356,7 @@ public class PwmApplication
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( "error generating about application bean: " + e.getMessage(), e );
+            LOGGER.error( () -> "error generating about application bean: " + e.getMessage(), e );
         }
         }
 
 
         try
         try
@@ -365,7 +365,7 @@ public class PwmApplication
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.warn( "error while clearing configmanager-intruder-username from intruder table: " + e.getMessage() );
+            LOGGER.warn( () -> "error while clearing configmanager-intruder-username from intruder table: " + e.getMessage() );
         }
         }
 
 
         if ( !pwmEnvironment.isInternalRuntimeInstance() )
         if ( !pwmEnvironment.isInternalRuntimeInstance() )
@@ -455,13 +455,13 @@ public class PwmApplication
                     tomcatSourceFile = new File( tomcatSourceFileStr );
                     tomcatSourceFile = new File( tomcatSourceFileStr );
                     if ( !tomcatSourceFile.exists() )
                     if ( !tomcatSourceFile.exists() )
                     {
                     {
-                        LOGGER.error( "can not output tomcat configuration file, source file does not exist: " + tomcatSourceFile.getAbsolutePath() );
+                        LOGGER.error( () -> "can not output tomcat configuration file, source file does not exist: " + tomcatSourceFile.getAbsolutePath() );
                         return;
                         return;
                     }
                     }
                 }
                 }
                 else
                 else
                 {
                 {
-                    LOGGER.error( "can not output tomcat configuration file, source file parameter '"
+                    LOGGER.error( () -> "can not output tomcat configuration file, source file parameter '"
                             + PwmEnvironment.ApplicationParameter.AutoWriteTomcatConfSourceFile.toString() + "' is not specified." );
                             + PwmEnvironment.ApplicationParameter.AutoWriteTomcatConfSourceFile.toString() + "' is not specified." );
                     return;
                     return;
                 }
                 }
@@ -700,7 +700,7 @@ public class PwmApplication
             }
             }
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
-                LOGGER.error( "error retrieving installation date from localDB: " + e.getMessage() );
+                LOGGER.error( () -> "error retrieving installation date from localDB: " + e.getMessage() );
             }
             }
         }
         }
         return Instant.now();
         return Instant.now();
@@ -785,7 +785,7 @@ public class PwmApplication
         final SmsQueueManager smsQueue = getSmsQueue();
         final SmsQueueManager smsQueue = getSmsQueue();
         if ( smsQueue == null )
         if ( smsQueue == null )
         {
         {
-            LOGGER.error( sessionLabel, "SMS queue is unavailable, unable to send SMS to: " + to );
+            LOGGER.error( sessionLabel, () -> "SMS queue is unavailable, unable to send SMS to: " + to );
             return;
             return;
         }
         }
 
 
@@ -801,7 +801,7 @@ public class PwmApplication
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.warn( "unable to add sms to queue: " + e.getMessage() );
+            LOGGER.warn( () -> "unable to add sms to queue: " + e.getMessage() );
         }
         }
     }
     }
 
 
@@ -809,7 +809,7 @@ public class PwmApplication
     {
     {
         pwmScheduler.shutdown();
         pwmScheduler.shutdown();
 
 
-        LOGGER.warn( "shutting down" );
+        LOGGER.warn( () -> "shutting down" );
         {
         {
             // send system audit event
             // send system audit event
             try
             try
@@ -825,7 +825,7 @@ public class PwmApplication
             }
             }
             catch ( final PwmException e )
             catch ( final PwmException e )
             {
             {
-                LOGGER.warn( "unable to submit shutdown alert event " + e.getMessage() );
+                LOGGER.warn( () -> "unable to submit shutdown alert event " + e.getMessage() );
             }
             }
         }
         }
 
 
@@ -841,7 +841,7 @@ public class PwmApplication
             }
             }
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
-                LOGGER.error( "error closing localDBLogger: " + e.getMessage(), e );
+                LOGGER.error( () -> "error closing localDBLogger: " + e.getMessage(), e );
             }
             }
             localDBLogger = null;
             localDBLogger = null;
         }
         }
@@ -855,7 +855,7 @@ public class PwmApplication
             }
             }
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
-                LOGGER.fatal( "error closing localDB: " + e, e );
+                LOGGER.fatal( () -> "error closing localDB: " + e, e );
             }
             }
             localDB = null;
             localDB = null;
         }
         }
@@ -895,7 +895,7 @@ public class PwmApplication
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
                 pwmApplication.lastLocalDBFailure = new ErrorInformation( PwmError.ERROR_LOCALDB_UNAVAILABLE, "error locating configured LocalDB directory: " + e.getMessage() );
                 pwmApplication.lastLocalDBFailure = new ErrorInformation( PwmError.ERROR_LOCALDB_UNAVAILABLE, "error locating configured LocalDB directory: " + e.getMessage() );
-                LOGGER.warn( pwmApplication.lastLocalDBFailure.toDebugStr() );
+                LOGGER.warn( () -> pwmApplication.lastLocalDBFailure.toDebugStr() );
                 throw new PwmUnrecoverableException( pwmApplication.lastLocalDBFailure );
                 throw new PwmUnrecoverableException( pwmApplication.lastLocalDBFailure );
             }
             }
 
 
@@ -910,7 +910,7 @@ public class PwmApplication
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
                 pwmApplication.lastLocalDBFailure = new ErrorInformation( PwmError.ERROR_LOCALDB_UNAVAILABLE, "unable to initialize LocalDB: " + e.getMessage() );
                 pwmApplication.lastLocalDBFailure = new ErrorInformation( PwmError.ERROR_LOCALDB_UNAVAILABLE, "unable to initialize LocalDB: " + e.getMessage() );
-                LOGGER.warn( pwmApplication.lastLocalDBFailure.toDebugStr() );
+                LOGGER.warn( () -> pwmApplication.lastLocalDBFailure.toDebugStr() );
                 throw new PwmUnrecoverableException( pwmApplication.lastLocalDBFailure );
                 throw new PwmUnrecoverableException( pwmApplication.lastLocalDBFailure );
             }
             }
         }
         }
@@ -930,7 +930,7 @@ public class PwmApplication
     {
     {
         if ( localDB == null || localDB.status() != LocalDB.Status.OPEN )
         if ( localDB == null || localDB.status() != LocalDB.Status.OPEN )
         {
         {
-            LOGGER.error( "error retrieving key '" + appAttribute.getKey() + "', localDB unavailable: " );
+            LOGGER.error( () -> "error retrieving key '" + appAttribute.getKey() + "', localDB unavailable: " );
             return null;
             return null;
         }
         }
 
 
@@ -946,7 +946,7 @@ public class PwmApplication
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( "error retrieving key '" + appAttribute.getKey() + "' value from localDB: " + e.getMessage() );
+            LOGGER.error( () -> "error retrieving key '" + appAttribute.getKey() + "' value from localDB: " + e.getMessage() );
         }
         }
         return null;
         return null;
     }
     }
@@ -955,7 +955,7 @@ public class PwmApplication
     {
     {
         if ( localDB == null || localDB.status() != LocalDB.Status.OPEN )
         if ( localDB == null || localDB.status() != LocalDB.Status.OPEN )
         {
         {
-            LOGGER.error( "error writing key '" + appAttribute.getKey() + "', localDB unavailable: " );
+            LOGGER.error( () -> "error writing key '" + appAttribute.getKey() + "', localDB unavailable: " );
             return;
             return;
         }
         }
 
 
@@ -978,14 +978,14 @@ public class PwmApplication
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( "error retrieving key '" + appAttribute.getKey() + "' installation date from localDB: " + e.getMessage() );
+            LOGGER.error( () -> "error retrieving key '" + appAttribute.getKey() + "' installation date from localDB: " + e.getMessage() );
             try
             try
             {
             {
                 localDB.remove( LocalDB.DB.PWM_META, appAttribute.getKey() );
                 localDB.remove( LocalDB.DB.PWM_META, appAttribute.getKey() );
             }
             }
             catch ( final Exception e2 )
             catch ( final Exception e2 )
             {
             {
-                LOGGER.error( "error removing bogus appAttribute value for key " + appAttribute.getKey() + ", error: " + localDB );
+                LOGGER.error( () -> "error removing bogus appAttribute value for key " + appAttribute.getKey() + ", error: " + localDB );
             }
             }
         }
         }
     }
     }

+ 8 - 8
server/src/main/java/password/pwm/PwmEnvironment.java

@@ -368,7 +368,7 @@ public class PwmEnvironment
                     }
                     }
                     else
                     else
                     {
                     {
-                        LOGGER.warn( "unknown " + EnvironmentParameter.applicationFlags.toString() + " value: " + input );
+                        LOGGER.warn( () -> "unknown " + EnvironmentParameter.applicationFlags.toString() + " value: " + input );
                     }
                     }
                 }
                 }
                 return Collections.unmodifiableList( returnFlags );
                 return Collections.unmodifiableList( returnFlags );
@@ -388,7 +388,7 @@ public class PwmEnvironment
                 }
                 }
                 else
                 else
                 {
                 {
-                    LOGGER.warn( "unknown " + EnvironmentParameter.applicationFlags.toString() + " value: " + input );
+                    LOGGER.warn( () -> "unknown " + EnvironmentParameter.applicationFlags.toString() + " value: " + input );
                 }
                 }
             }
             }
             return returnFlags;
             return returnFlags;
@@ -408,7 +408,7 @@ public class PwmEnvironment
             }
             }
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
-                LOGGER.warn( "error reading properties file '" + input + "' specified by environment setting "
+                LOGGER.warn( () -> "error reading properties file '" + input + "' specified by environment setting "
                         + EnvironmentParameter.applicationParamFile.toString() + ", error: " + e.getMessage() );
                         + EnvironmentParameter.applicationParamFile.toString() + ", error: " + e.getMessage() );
             }
             }
 
 
@@ -425,14 +425,14 @@ public class PwmEnvironment
                     }
                     }
                     else
                     else
                     {
                     {
-                        LOGGER.warn( "unknown " + EnvironmentParameter.applicationParamFile.toString() + " value: " + input );
+                        LOGGER.warn( () -> "unknown " + EnvironmentParameter.applicationParamFile.toString() + " value: " + input );
                     }
                     }
                 }
                 }
                 return Collections.unmodifiableMap( returnParams );
                 return Collections.unmodifiableMap( returnParams );
             }
             }
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
-                LOGGER.warn( "unable to parse jason value of " + EnvironmentParameter.applicationParamFile.toString() + ", error: " + e.getMessage() );
+                LOGGER.warn( () -> "unable to parse jason value of " + EnvironmentParameter.applicationParamFile.toString() + ", error: " + e.getMessage() );
             }
             }
 
 
             return Collections.emptyMap();
             return Collections.emptyMap();
@@ -628,7 +628,7 @@ public class PwmEnvironment
                 }
                 }
                 catch ( final Exception e )
                 catch ( final Exception e )
                 {
                 {
-                    LOGGER.error( "unable to obtain file lock on file " + lockfile.getAbsolutePath() + " due to error: " + e.getMessage() );
+                    LOGGER.error( () -> "unable to obtain file lock on file " + lockfile.getAbsolutePath() + " due to error: " + e.getMessage() );
                 }
                 }
             }
             }
         }
         }
@@ -648,7 +648,7 @@ public class PwmEnvironment
             }
             }
             catch ( final IOException e )
             catch ( final IOException e )
             {
             {
-                LOGGER.error( "unable to write contents of application lock file: " + e.getMessage() );
+                LOGGER.error( () -> "unable to write contents of application lock file: " + e.getMessage() );
             }
             }
             // do not close FileWriter, otherwise lock is released.
             // do not close FileWriter, otherwise lock is released.
         }
         }
@@ -663,7 +663,7 @@ public class PwmEnvironment
                 }
                 }
                 catch ( final IOException e )
                 catch ( final IOException e )
                 {
                 {
-                    LOGGER.error( "error releasing file lock: " + e.getMessage() );
+                    LOGGER.error( () -> "error releasing file lock: " + e.getMessage() );
                 }
                 }
 
 
                 LOGGER.debug( () -> "released file lock on file " + lockfile.getAbsolutePath() );
                 LOGGER.debug( () -> "released file lock on file " + lockfile.getAbsolutePath() );

+ 8 - 8
server/src/main/java/password/pwm/config/Configuration.java

@@ -448,12 +448,12 @@ public class Configuration implements SettingReader
                 {
                 {
                     if ( e1.getCause() instanceof IllegalArgumentException )
                     if ( e1.getCause() instanceof IllegalArgumentException )
                     {
                     {
-                        LOGGER.error( "illegal setting value for option '" + strValue + "' for setting key '" + setting.getKey() + "' is not recognized, will use default" );
+                        LOGGER.error( () -> "illegal setting value for option '" + strValue + "' for setting key '" + setting.getKey() + "' is not recognized, will use default" );
                     }
                     }
                 }
                 }
                 catch ( final Exception e1 )
                 catch ( final Exception e1 )
                 {
                 {
-                    LOGGER.error( "unexpected error", e1 );
+                    LOGGER.error( () -> "unexpected error", e1 );
                 }
                 }
             }
             }
 
 
@@ -479,12 +479,12 @@ public class Configuration implements SettingReader
                 {
                 {
                     if ( e1.getCause() instanceof IllegalArgumentException )
                     if ( e1.getCause() instanceof IllegalArgumentException )
                     {
                     {
-                        LOGGER.error( "illegal setting value for option '" + strValue + "' is not recognized, will use default" );
+                        LOGGER.error( () -> "illegal setting value for option '" + strValue + "' is not recognized, will use default" );
                     }
                     }
                 }
                 }
                 catch ( final Exception e1 )
                 catch ( final Exception e1 )
                 {
                 {
-                    LOGGER.error( "unexpected error", e1 );
+                    LOGGER.error( () -> "unexpected error", e1 );
                 }
                 }
             }
             }
 
 
@@ -731,7 +731,7 @@ public class Configuration implements SettingReader
             {
             {
                 final String errorMsg = "Security Key value is not configured, will generate temp value for use by runtime instance";
                 final String errorMsg = "Security Key value is not configured, will generate temp value for use by runtime instance";
                 final ErrorInformation errorInfo = new ErrorInformation( PwmError.ERROR_INVALID_SECURITY_KEY, errorMsg );
                 final ErrorInformation errorInfo = new ErrorInformation( PwmError.ERROR_INVALID_SECURITY_KEY, errorMsg );
-                LOGGER.warn( errorInfo.toDebugStr() );
+                LOGGER.warn( () -> errorInfo.toDebugStr() );
                 if ( tempInstanceKey == null )
                 if ( tempInstanceKey == null )
                 {
                 {
                     tempInstanceKey = new PwmSecurityKey( PwmRandom.getInstance().alphaNumericString( 1024 ) );
                     tempInstanceKey = new PwmSecurityKey( PwmRandom.getInstance().alphaNumericString( 1024 ) );
@@ -756,7 +756,7 @@ public class Configuration implements SettingReader
                 {
                 {
                     final String errorMsg = "unexpected error generating Security Key crypto: " + e.getMessage();
                     final String errorMsg = "unexpected error generating Security Key crypto: " + e.getMessage();
                     final ErrorInformation errorInfo = new ErrorInformation( PwmError.ERROR_INVALID_SECURITY_KEY, errorMsg );
                     final ErrorInformation errorInfo = new ErrorInformation( PwmError.ERROR_INVALID_SECURITY_KEY, errorMsg );
-                    LOGGER.error( errorInfo.toDebugStr(), e );
+                    LOGGER.error( () -> errorInfo.toDebugStr(), e );
                     throw new PwmUnrecoverableException( errorInfo );
                     throw new PwmUnrecoverableException( errorInfo );
                 }
                 }
             }
             }
@@ -788,7 +788,7 @@ public class Configuration implements SettingReader
             }
             }
             catch ( final IllegalArgumentException e )
             catch ( final IllegalArgumentException e )
             {
             {
-                LOGGER.error( "unknown STORAGE_METHOD found: " + rawValue );
+                LOGGER.error( () -> "unknown STORAGE_METHOD found: " + rawValue );
             }
             }
         }
         }
         return storageMethods;
         return storageMethods;
@@ -879,7 +879,7 @@ public class Configuration implements SettingReader
         {
         {
             final String errorMsg = "unknown storage method specified: " + readSettingAsString( PwmSetting.TOKEN_STORAGEMETHOD );
             final String errorMsg = "unknown storage method specified: " + readSettingAsString( PwmSetting.TOKEN_STORAGEMETHOD );
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_INVALID_CONFIG, errorMsg );
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_INVALID_CONFIG, errorMsg );
-            LOGGER.warn( errorInformation.toDebugStr() );
+            LOGGER.warn( () -> errorInformation.toDebugStr() );
             return null;
             return null;
         }
         }
     }
     }

+ 2 - 2
server/src/main/java/password/pwm/config/PwmSetting.java

@@ -1531,7 +1531,7 @@ public enum PwmSetting
                 }
                 }
                 catch ( final IllegalArgumentException e )
                 catch ( final IllegalArgumentException e )
                 {
                 {
-                    LOGGER.error( "unknown flag for setting " + pwmSetting.getKey() + ", error: unknown flag value: " + value );
+                    LOGGER.error( () -> "unknown flag for setting " + pwmSetting.getKey() + ", error: unknown flag value: " + value );
                 }
                 }
 
 
             }
             }
@@ -1701,7 +1701,7 @@ public enum PwmSetting
                 catch ( final PatternSyntaxException e )
                 catch ( final PatternSyntaxException e )
                 {
                 {
                     final String errorMsg = "error compiling regex constraints for setting " + pwmSetting.toString() + ", error: " + e.getMessage();
                     final String errorMsg = "error compiling regex constraints for setting " + pwmSetting.toString() + ", error: " + e.getMessage();
-                    LOGGER.error( errorMsg, e );
+                    LOGGER.error( () -> errorMsg, e );
                     throw new IllegalStateException( errorMsg, e );
                     throw new IllegalStateException( errorMsg, e );
                 }
                 }
             }
             }

+ 1 - 1
server/src/main/java/password/pwm/config/function/UserMatchViewerFunction.java

@@ -144,7 +144,7 @@ public class UserMatchViewerFunction implements SettingUIFunction
             }
             }
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
-                LOGGER.error( "error while testing entry DN for profile '" + profileID + "', error:" + profileID );
+                LOGGER.error( () -> "error while testing entry DN for profile '" + profileID + "', error:" + profileID );
             }
             }
             try
             try
             {
             {

+ 1 - 1
server/src/main/java/password/pwm/config/profile/LdapProfile.java

@@ -175,7 +175,7 @@ public class LdapProfile extends AbstractProfile implements Profile
             }
             }
             catch ( final ChaiUnavailableException | ChaiOperationException e )
             catch ( final ChaiUnavailableException | ChaiOperationException e )
             {
             {
-                LOGGER.error( "error while reading canonicalDN for dn value '" + dnValue + "', error: " + e.getMessage() );
+                LOGGER.error( () -> "error while reading canonicalDN for dn value '" + dnValue + "', error: " + e.getMessage() );
                 return dnValue;
                 return dnValue;
             }
             }
         }
         }

+ 1 - 1
server/src/main/java/password/pwm/config/profile/PwmPasswordPolicy.java

@@ -113,7 +113,7 @@ public class PwmPasswordPolicy implements Profile, Serializable
         }
         }
         catch ( final Throwable t )
         catch ( final Throwable t )
         {
         {
-            LOGGER.fatal( "error initializing PwmPasswordPolicy class: " + t.getMessage(), t );
+            LOGGER.fatal( () -> "error initializing PwmPasswordPolicy class: " + t.getMessage(), t );
         }
         }
         DEFAULT_POLICY = newDefaultPolicy;
         DEFAULT_POLICY = newDefaultPolicy;
     }
     }

+ 1 - 1
server/src/main/java/password/pwm/config/profile/PwmPasswordRule.java

@@ -405,7 +405,7 @@ public enum PwmPasswordRule
         }
         }
         catch ( final Throwable t )
         catch ( final Throwable t )
         {
         {
-            LOGGER.fatal( "error initializing PwmPasswordRule class: " + t.getMessage(), t );
+            LOGGER.fatal( () -> "error initializing PwmPasswordRule class: " + t.getMessage(), t );
         }
         }
     }
     }
 
 

+ 3 - 3
server/src/main/java/password/pwm/config/stored/ConfigurationReader.java

@@ -85,7 +85,7 @@ public class ConfigurationReader
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
             this.configFileError = e.getErrorInformation();
             this.configFileError = e.getErrorInformation();
-            LOGGER.warn( "error reading configuration file: " + e.getMessage() );
+            LOGGER.warn( () -> "error reading configuration file: " + e.getMessage() );
         }
         }
 
 
         if ( storedConfiguration == null )
         if ( storedConfiguration == null )
@@ -124,7 +124,7 @@ public class ConfigurationReader
 
 
         if ( !configFile.exists() )
         if ( !configFile.exists() )
         {
         {
-            LOGGER.warn( "configuration file '" + configFile.getAbsolutePath() + "' does not exist" );
+            LOGGER.warn( () -> "configuration file '" + configFile.getAbsolutePath() + "' does not exist" );
             return null;
             return null;
         }
         }
 
 
@@ -251,7 +251,7 @@ public class ConfigurationReader
             }
             }
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
-                LOGGER.error( sessionLabel, "error trying to parse previous config epoch property: " + e.getMessage() );
+                LOGGER.error( sessionLabel, () -> "error trying to parse previous config epoch property: " + e.getMessage() );
             }
             }
 
 
             final StoredConfigurationModifier modifier = StoredConfigurationModifier.newModifier( storedConfiguration );
             final StoredConfigurationModifier modifier = StoredConfigurationModifier.newModifier( storedConfiguration );

+ 2 - 2
server/src/main/java/password/pwm/config/stored/StoredConfigurationFactory.java

@@ -306,7 +306,7 @@ public class StoredConfigurationFactory
                 }
                 }
                 catch ( final Exception e )
                 catch ( final Exception e )
                 {
                 {
-                    LOGGER.error( "error parsing root last modified timestamp: " + e.getMessage() );
+                    LOGGER.error( () -> "error parsing root last modified timestamp: " + e.getMessage() );
                 }
                 }
             }
             }
 
 
@@ -334,7 +334,7 @@ public class StoredConfigurationFactory
                 }
                 }
                 catch ( final IllegalStateException e )
                 catch ( final IllegalStateException e )
                 {
                 {
-                    LOGGER.error( "error reading template", e );
+                    LOGGER.error( () -> "error reading template", e );
                 }
                 }
             }
             }
             return null;
             return null;

+ 1 - 1
server/src/main/java/password/pwm/config/stored/StoredConfigurationImpl.java

@@ -172,7 +172,7 @@ public class StoredConfigurationImpl implements StoredConfiguration
             }
             }
             catch ( final IllegalStateException e )
             catch ( final IllegalStateException e )
             {
             {
-                LOGGER.error( "error reading template", e );
+                LOGGER.error( () -> "error reading template", e );
             }
             }
         }
         }
 
 

+ 1 - 1
server/src/main/java/password/pwm/config/stored/StoredConfigurationUtil.java

@@ -204,7 +204,7 @@ public abstract class StoredConfigurationUtil
                 }
                 }
                 catch ( final Exception e )
                 catch ( final Exception e )
                 {
                 {
-                    LOGGER.error( "unexpected error during validate value for "
+                    LOGGER.error( () -> "unexpected error during validate value for "
                             + pwmSetting.toMenuLocationDebug( profileID, PwmConstants.DEFAULT_LOCALE ) + ", error: "
                             + pwmSetting.toMenuLocationDebug( profileID, PwmConstants.DEFAULT_LOCALE ) + ", error: "
                             + e.getMessage(), e );
                             + e.getMessage(), e );
                 }
                 }

+ 2 - 2
server/src/main/java/password/pwm/config/value/ActionValue.java

@@ -164,7 +164,7 @@ public class ActionValue extends AbstractValue implements StoredValue
                                 }
                                 }
                                 catch ( final PwmOperationalException e )
                                 catch ( final PwmOperationalException e )
                                 {
                                 {
-                                    LOGGER.warn( "error decoding stored pw value on setting '" + pwmSetting.getKey() + "': " + e.getMessage() );
+                                    LOGGER.warn( () -> "error decoding stored pw value on setting '" + pwmSetting.getKey() + "': " + e.getMessage() );
                                 }
                                 }
                             }
                             }
 
 
@@ -205,7 +205,7 @@ public class ActionValue extends AbstractValue implements StoredValue
                     }
                     }
                     catch ( final PwmOperationalException e )
                     catch ( final PwmOperationalException e )
                     {
                     {
-                        LOGGER.warn( "error encoding stored pw value: " + e.getMessage() );
+                        LOGGER.warn( () -> "error encoding stored pw value: " + e.getMessage() );
                     }
                     }
                 }
                 }
             }
             }

+ 2 - 2
server/src/main/java/password/pwm/config/value/FileValue.java

@@ -131,7 +131,7 @@ public class FileValue extends AbstractValue implements StoredValue
                             }
                             }
                             catch ( final IOException e )
                             catch ( final IOException e )
                             {
                             {
-                                LOGGER.error( "error reading file contents item: " + e.getMessage(), e );
+                                LOGGER.error( () -> "error reading file contents item: " + e.getMessage(), e );
                             }
                             }
                         }
                         }
                     }
                     }
@@ -169,7 +169,7 @@ public class FileValue extends AbstractValue implements StoredValue
             }
             }
             catch ( final IOException e )
             catch ( final IOException e )
             {
             {
-                LOGGER.error( "unexpected error writing setting to xml, IO error during base64 encoding: " + e.getMessage() );
+                LOGGER.error( () -> "unexpected error writing setting to xml, IO error during base64 encoding: " + e.getMessage() );
             }
             }
             valueElement.addContent( fileContentElement );
             valueElement.addContent( fileContentElement );
 
 

+ 3 - 3
server/src/main/java/password/pwm/config/value/PrivateKeyValue.java

@@ -78,7 +78,7 @@ public class PrivateKeyValue extends AbstractValue
                             }
                             }
                             catch ( final Exception e )
                             catch ( final Exception e )
                             {
                             {
-                                LOGGER.error( "error reading certificate: " + e.getMessage(), e );
+                                LOGGER.error( () -> "error reading certificate: " + e.getMessage(), e );
                             }
                             }
 
 
                         }
                         }
@@ -100,12 +100,12 @@ public class PrivateKeyValue extends AbstractValue
                             }
                             }
                             else
                             else
                             {
                             {
-                                LOGGER.error( "error reading privateKey for setting: '" + pwmSetting.getKey() + "': missing 'value' element" );
+                                LOGGER.error( () -> "error reading privateKey for setting: '" + pwmSetting.getKey() + "': missing 'value' element" );
                             }
                             }
                         }
                         }
                         catch ( final Exception e )
                         catch ( final Exception e )
                         {
                         {
-                            LOGGER.error( "error reading privateKey for setting: '" + pwmSetting.getKey() + "': " + e.getMessage(), e );
+                            LOGGER.error( () -> "error reading privateKey for setting: '" + pwmSetting.getKey() + "': " + e.getMessage(), e );
                         }
                         }
 
 
                         if ( !certificates.isEmpty() && privateKey != null )
                         if ( !certificates.isEmpty() && privateKey != null )

+ 1 - 1
server/src/main/java/password/pwm/config/value/RemoteWebServiceValue.java

@@ -131,7 +131,7 @@ public class RemoteWebServiceValue extends AbstractValue implements StoredValue
             }
             }
             catch ( final PwmOperationalException e )
             catch ( final PwmOperationalException e )
             {
             {
-                LOGGER.warn( "error decoding stored pw value: " + e.getMessage() );
+                LOGGER.warn( () -> "error decoding stored pw value: " + e.getMessage() );
             }
             }
 
 
             final RemoteWebServiceConfiguration clonedValue = value.toBuilder().password( encodedValue ).build();
             final RemoteWebServiceConfiguration clonedValue = value.toBuilder().password( encodedValue ).build();

+ 2 - 2
server/src/main/java/password/pwm/config/value/StoredValueEncoder.java

@@ -200,7 +200,7 @@ public abstract class StoredValueEncoder
             {
             {
                 final String errorMsg = "unable to decrypt config password value for setting: " + e.getMessage();
                 final String errorMsg = "unable to decrypt config password value for setting: " + e.getMessage();
                 final ErrorInformation errorInfo = new ErrorInformation( PwmError.CONFIG_FORMAT_ERROR, errorMsg );
                 final ErrorInformation errorInfo = new ErrorInformation( PwmError.CONFIG_FORMAT_ERROR, errorMsg );
-                LOGGER.warn( errorInfo.toDebugStr() );
+                LOGGER.warn( () -> errorInfo.toDebugStr() );
                 throw new PwmOperationalException( errorInfo );
                 throw new PwmOperationalException( errorInfo );
             }
             }
         }
         }
@@ -252,7 +252,7 @@ public abstract class StoredValueEncoder
             {
             {
                 final String errorMsg = "unable to decrypt password value for setting: " + e.getMessage();
                 final String errorMsg = "unable to decrypt password value for setting: " + e.getMessage();
                 final ErrorInformation errorInfo = new ErrorInformation( PwmError.CONFIG_FORMAT_ERROR, errorMsg );
                 final ErrorInformation errorInfo = new ErrorInformation( PwmError.CONFIG_FORMAT_ERROR, errorMsg );
-                LOGGER.warn( errorInfo.toDebugStr() );
+                LOGGER.warn( () -> errorInfo.toDebugStr() );
                 throw new PwmOperationalException( errorInfo );
                 throw new PwmOperationalException( errorInfo );
             }
             }
         }
         }

+ 2 - 2
server/src/main/java/password/pwm/config/value/ValueFactory.java

@@ -50,7 +50,7 @@ public class ValueFactory
             {
             {
                 errorMsg.append( ", cause: " ).append( e.getCause().getMessage() );
                 errorMsg.append( ", cause: " ).append( e.getCause().getMessage() );
             }
             }
-            LOGGER.error( errorMsg, e );
+            LOGGER.error( () -> errorMsg, e );
             throw new PwmOperationalException( new ErrorInformation( PwmError.CONFIG_FORMAT_ERROR, errorMsg.toString() ) );
             throw new PwmOperationalException( new ErrorInformation( PwmError.CONFIG_FORMAT_ERROR, errorMsg.toString() ) );
         }
         }
     }
     }
@@ -70,7 +70,7 @@ public class ValueFactory
             {
             {
                 errorMsg.append( ", cause: " ).append( e.getCause().getMessage() );
                 errorMsg.append( ", cause: " ).append( e.getCause().getMessage() );
             }
             }
-            LOGGER.error( errorMsg, e );
+            LOGGER.error( () -> errorMsg, e );
             throw new IllegalStateException( "unable to read xml element '" + settingElement.getName() + "' from setting '" + setting.getKey() + "' error: " + e.getMessage(), e );
             throw new IllegalStateException( "unable to read xml element '" + settingElement.getName() + "' from setting '" + setting.getKey() + "' error: " + e.getMessage(), e );
         }
         }
     }
     }

+ 3 - 3
server/src/main/java/password/pwm/config/value/X509CertificateValue.java

@@ -70,7 +70,7 @@ public class X509CertificateValue extends AbstractValue implements StoredValue
                     }
                     }
                     catch ( final Exception e )
                     catch ( final Exception e )
                     {
                     {
-                        LOGGER.error( "error decoding certificate: " + e.getMessage() );
+                        LOGGER.error( () -> "error decoding certificate: " + e.getMessage() );
                     }
                     }
                 }
                 }
                 return new X509CertificateValue( certificates.toArray( new X509Certificate[ certificates.size() ] ) );
                 return new X509CertificateValue( certificates.toArray( new X509Certificate[ certificates.size() ] ) );
@@ -122,7 +122,7 @@ public class X509CertificateValue extends AbstractValue implements StoredValue
             }
             }
             catch ( final CertificateEncodingException e )
             catch ( final CertificateEncodingException e )
             {
             {
-                LOGGER.error( "error encoding certificate: " + e.getMessage() );
+                LOGGER.error( () -> "error encoding certificate: " + e.getMessage() );
             }
             }
             returnList.add( valueElement );
             returnList.add( valueElement );
         }
         }
@@ -162,7 +162,7 @@ public class X509CertificateValue extends AbstractValue implements StoredValue
             }
             }
             catch ( final PwmUnrecoverableException | CertificateEncodingException e )
             catch ( final PwmUnrecoverableException | CertificateEncodingException e )
             {
             {
-                LOGGER.warn( "error generating hash for certificate: " + e.getMessage() );
+                LOGGER.warn( () -> "error generating hash for certificate: " + e.getMessage() );
             }
             }
         }
         }
         return sb.toString();
         return sb.toString();

+ 2 - 2
server/src/main/java/password/pwm/config/value/data/ShortcutItem.java

@@ -63,7 +63,7 @@ public class ShortcutItem implements Serializable
             }
             }
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
-                LOGGER.warn( "malformed ShortcutItem configuration value of '" + input + "', " + e.getMessage() );
+                LOGGER.warn( () -> "malformed ShortcutItem configuration value of '" + input + "', " + e.getMessage() );
             }
             }
         }
         }
         throw new IllegalArgumentException( "malformed ShortcutItem configuration value of '" + input + "'" );
         throw new IllegalArgumentException( "malformed ShortcutItem configuration value of '" + input + "'" );
@@ -86,7 +86,7 @@ public class ShortcutItem implements Serializable
             }
             }
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
-                LOGGER.warn( "malformed ShortcutItem configuration value of '" + input + "', " + e.getMessage() );
+                LOGGER.warn( () -> "malformed ShortcutItem configuration value of '" + input + "', " + e.getMessage() );
             }
             }
         }
         }
         throw new IllegalArgumentException( "malformed ShortcutItem configuration value of '" + input + "'" );
         throw new IllegalArgumentException( "malformed ShortcutItem configuration value of '" + input + "'" );

+ 1 - 1
server/src/main/java/password/pwm/health/ApplianceStatusChecker.java

@@ -74,7 +74,7 @@ public class ApplianceStatusChecker implements HealthChecker
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( SessionLabel.HEALTH_SESSION_LABEL, "error communicating with client " + e.getMessage() );
+            LOGGER.error( SessionLabel.HEALTH_SESSION_LABEL, () -> "error communicating with client " + e.getMessage() );
         }
         }
 
 
         return healthRecords;
         return healthRecords;

+ 1 - 1
server/src/main/java/password/pwm/health/CertificateChecker.java

@@ -61,7 +61,7 @@ public class CertificateChecker implements HealthChecker
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.error( "error while checking action certificates: " + e.getMessage(), e );
+            LOGGER.error( () -> "error while checking action certificates: " + e.getMessage(), e );
         }
         }
         return records;
         return records;
     }
     }

+ 3 - 3
server/src/main/java/password/pwm/health/ConfigurationChecker.java

@@ -125,7 +125,7 @@ public class ConfigurationChecker implements HealthChecker
             }
             }
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
-                LOGGER.error( "unexpected error during health check operation for class " + clazz.toString() + ", error:" + e.getMessage(), e );
+                LOGGER.error( () -> "unexpected error during health check operation for class " + clazz.toString() + ", error:" + e.getMessage(), e );
             }
             }
         }
         }
         return records;
         return records;
@@ -260,7 +260,7 @@ public class ConfigurationChecker implements HealthChecker
             }
             }
             catch ( final PwmUnrecoverableException e )
             catch ( final PwmUnrecoverableException e )
             {
             {
-                LOGGER.error( "unexpected error examining password strength of configuration: " );
+                LOGGER.error( () -> "unexpected error examining password strength of configuration: " );
             }
             }
 
 
             return Collections.unmodifiableList( records );
             return Collections.unmodifiableList( records );
@@ -373,7 +373,7 @@ public class ConfigurationChecker implements HealthChecker
                 }
                 }
                 catch ( final Exception e )
                 catch ( final Exception e )
                 {
                 {
-                    LOGGER.error( "unexpected error during password policy health check: " + e.getMessage(), e );
+                    LOGGER.error( () -> "unexpected error during password policy health check: " + e.getMessage(), e );
                 }
                 }
             }
             }
             return records;
             return records;

+ 1 - 1
server/src/main/java/password/pwm/health/DatabaseStatusChecker.java

@@ -64,7 +64,7 @@ public class DatabaseStatusChecker implements HealthChecker
         }
         }
         catch ( final PwmException e )
         catch ( final PwmException e )
         {
         {
-            LOGGER.error( "error during healthcheck: " + e.getMessage() );
+            LOGGER.error( () -> "error during healthcheck: " + e.getMessage() );
             e.printStackTrace();
             e.printStackTrace();
             return runtimeInstance.getDatabaseService().healthCheck();
             return runtimeInstance.getDatabaseService().healthCheck();
         }
         }

+ 3 - 3
server/src/main/java/password/pwm/health/HealthMonitor.java

@@ -247,7 +247,7 @@ public class HealthMonitor implements PwmService
             {
             {
                 if ( status == STATUS.OPEN )
                 if ( status == STATUS.OPEN )
                 {
                 {
-                    LOGGER.warn( "unexpected error during healthCheck: " + e.getMessage(), e );
+                    LOGGER.warn( () -> "unexpected error during healthCheck: " + e.getMessage(), e );
                 }
                 }
             }
             }
         }
         }
@@ -265,7 +265,7 @@ public class HealthMonitor implements PwmService
             {
             {
                 if ( status == STATUS.OPEN )
                 if ( status == STATUS.OPEN )
                 {
                 {
-                    LOGGER.warn( "unexpected error during healthCheck: " + e.getMessage(), e );
+                    LOGGER.warn( () -> "unexpected error during healthCheck: " + e.getMessage(), e );
                 }
                 }
             }
             }
         }
         }
@@ -309,7 +309,7 @@ public class HealthMonitor implements PwmService
             }
             }
             catch ( final Throwable e )
             catch ( final Throwable e )
             {
             {
-                LOGGER.error( "error during health check execution: " + e.getMessage(), e );
+                LOGGER.error( () -> "error during health check execution: " + e.getMessage(), e );
             }
             }
         }
         }
     }
     }

+ 9 - 9
server/src/main/java/password/pwm/health/LDAPHealthChecker.java

@@ -356,7 +356,7 @@ public class LDAPHealthChecker implements HealthChecker
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
                 final String msg = "error setting test user password: " + JavaHelper.readHostileExceptionMessage( e );
                 final String msg = "error setting test user password: " + JavaHelper.readHostileExceptionMessage( e );
-                LOGGER.error( SessionLabel.HEALTH_SESSION_LABEL, msg, e );
+                LOGGER.error( SessionLabel.HEALTH_SESSION_LABEL, () -> msg, e );
                 returnRecords.add( HealthRecord.forMessage( HealthMessage.LDAP_TestUserUnexpected,
                 returnRecords.add( HealthRecord.forMessage( HealthMessage.LDAP_TestUserUnexpected,
                         PwmSetting.LDAP_TEST_USER_DN.toMenuLocationDebug( ldapProfile.getIdentifier(), PwmConstants.DEFAULT_LOCALE ),
                         PwmSetting.LDAP_TEST_USER_DN.toMenuLocationDebug( ldapProfile.getIdentifier(), PwmConstants.DEFAULT_LOCALE ),
                         msg
                         msg
@@ -702,7 +702,7 @@ public class LDAPHealthChecker implements HealthChecker
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
             errorReachingServer = true;
             errorReachingServer = true;
-            LOGGER.error( SessionLabel.HEALTH_SESSION_LABEL, "error during replica vendor sameness check: " + e.getMessage() );
+            LOGGER.error( SessionLabel.HEALTH_SESSION_LABEL, () -> "error during replica vendor sameness check: " + e.getMessage() );
         }
         }
 
 
         final ArrayList<HealthRecord> healthRecords = new ArrayList<>();
         final ArrayList<HealthRecord> healthRecords = new ArrayList<>();
@@ -725,7 +725,7 @@ public class LDAPHealthChecker implements HealthChecker
             // cache the error
             // cache the error
             healthProperties.put( HealthMonitor.HealthMonitorFlag.LdapVendorSameCheck, healthRecords );
             healthProperties.put( HealthMonitor.HealthMonitorFlag.LdapVendorSameCheck, healthRecords );
 
 
-            LOGGER.warn( SessionLabel.HEALTH_SESSION_LABEL, "multiple ldap vendors found: " + vendorMsg.toString() );
+            LOGGER.warn( SessionLabel.HEALTH_SESSION_LABEL, () -> "multiple ldap vendors found: " + vendorMsg.toString() );
         }
         }
         else if ( discoveredVendors.size() == 1 )
         else if ( discoveredVendors.size() == 1 )
         {
         {
@@ -792,7 +792,7 @@ public class LDAPHealthChecker implements HealthChecker
                                 url
                                 url
                         );
                         );
                         healthRecords.add( record );
                         healthRecords.add( record );
-                        LOGGER.warn( record.toDebugString( PwmConstants.DEFAULT_LOCALE, pwmApplication.getConfig() ) );
+                        LOGGER.warn( () -> record.toDebugString( PwmConstants.DEFAULT_LOCALE, pwmApplication.getConfig() ) );
                     }
                     }
                 }
                 }
             }
             }
@@ -801,7 +801,7 @@ public class LDAPHealthChecker implements HealthChecker
         {
         {
             errorReachingServer = true;
             errorReachingServer = true;
             LOGGER.error( SessionLabel.HEALTH_SESSION_LABEL,
             LOGGER.error( SessionLabel.HEALTH_SESSION_LABEL,
-                    "error during ad api password policy (asn " + PwmConstants.LDAP_AD_PASSWORD_POLICY_CONTROL_ASN + ") check: " + e.getMessage() );
+                    () ->  "error during ad api password policy (asn " + PwmConstants.LDAP_AD_PASSWORD_POLICY_CONTROL_ASN + ") check: " + e.getMessage() );
         }
         }
 
 
         if ( !errorReachingServer && pwmApplication.getHealthMonitor() != null )
         if ( !errorReachingServer && pwmApplication.getHealthMonitor() != null )
@@ -832,7 +832,7 @@ public class LDAPHealthChecker implements HealthChecker
                         }
                         }
                         catch ( final PwmUnrecoverableException e )
                         catch ( final PwmUnrecoverableException e )
                         {
                         {
-                            LOGGER.error( "error checking configured permission settings:" + e.getMessage() );
+                            LOGGER.error( () -> "error checking configured permission settings:" + e.getMessage() );
                         }
                         }
                     }
                     }
                 }
                 }
@@ -890,7 +890,7 @@ public class LDAPHealthChecker implements HealthChecker
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.warn( "error while checking DN ldap syntax values: " + e.getMessage() );
+            LOGGER.warn( () -> "error while checking DN ldap syntax values: " + e.getMessage() );
         }
         }
 
 
         return returnList;
         return returnList;
@@ -957,7 +957,7 @@ public class LDAPHealthChecker implements HealthChecker
             }
             }
             catch ( final PwmUnrecoverableException e )
             catch ( final PwmUnrecoverableException e )
             {
             {
-                LOGGER.error( "error checking new user password policy user settings:" + e.getMessage() );
+                LOGGER.error( () -> "error checking new user password policy user settings:" + e.getMessage() );
             }
             }
         }
         }
 
 
@@ -1118,7 +1118,7 @@ public class LDAPHealthChecker implements HealthChecker
         }
         }
         catch ( final ChaiException e )
         catch ( final ChaiException e )
         {
         {
-            LOGGER.error( "error while evaluating ldap DN '" + dnValue + "', error: " + e.getMessage() );
+            LOGGER.error( () -> "error while evaluating ldap DN '" + dnValue + "', error: " + e.getMessage() );
         }
         }
         return Optional.empty();
         return Optional.empty();
     }
     }

+ 7 - 7
server/src/main/java/password/pwm/http/ContextManager.java

@@ -359,7 +359,7 @@ public class ContextManager implements Serializable
 
 
         try
         try
         {
         {
-            LOGGER.fatal( SESSION_LABEL, startupErrorInformation.getDetailedErrorMsg() );
+            LOGGER.fatal( SESSION_LABEL, () -> startupErrorInformation.getDetailedErrorMsg() );
         }
         }
         catch ( final Exception e2 )
         catch ( final Exception e2 )
         {
         {
@@ -381,7 +381,7 @@ public class ContextManager implements Serializable
             }
             }
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
-                LOGGER.error( "unexpected error attempting to close application: " + e.getMessage() );
+                LOGGER.error( () -> "unexpected error attempting to close application: " + e.getMessage() );
             }
             }
         }
         }
         taskMaster.shutdown();
         taskMaster.shutdown();
@@ -447,7 +447,7 @@ public class ContextManager implements Serializable
                     }
                     }
                     catch ( final Exception e )
                     catch ( final Exception e )
                     {
                     {
-                        LOGGER.error( SESSION_LABEL, "error importing " + silentPropertiesFile.getAbsolutePath() + ", error: " + e.getMessage() );
+                        LOGGER.error( SESSION_LABEL, () -> "error importing " + silentPropertiesFile.getAbsolutePath() + ", error: " + e.getMessage() );
                     }
                     }
 
 
                     final String appendValue = success ? ".imported" : ".error";
                     final String appendValue = success ? ".imported" : ".error";
@@ -461,7 +461,7 @@ public class ContextManager implements Serializable
                     }
                     }
                     catch ( final IOException e )
                     catch ( final IOException e )
                     {
                     {
-                        LOGGER.error( SESSION_LABEL, "error renaming file " + source.toString() + " to " + dest.toString() + ", error: " + e.getMessage() );
+                        LOGGER.error( SESSION_LABEL, () -> "error renaming file " + source.toString() + " to " + dest.toString() + ", error: " + e.getMessage() );
                     }
                     }
                 }
                 }
             }
             }
@@ -519,12 +519,12 @@ public class ContextManager implements Serializable
                     }
                     }
                     catch ( final Exception e )
                     catch ( final Exception e )
                     {
                     {
-                        LOGGER.error( SESSION_LABEL, "unexpected error attempting to close application: " + e.getMessage() );
+                        LOGGER.error( SESSION_LABEL, () -> "unexpected error attempting to close application: " + e.getMessage() );
                     }
                     }
                 }
                 }
                 catch ( final Exception e )
                 catch ( final Exception e )
                 {
                 {
-                    LOGGER.fatal( "unexpected error during shutdown: " + e.getMessage(), e );
+                    LOGGER.fatal( () -> "unexpected error during shutdown: " + e.getMessage(), e );
                 }
                 }
 
 
                 {
                 {
@@ -728,7 +728,7 @@ public class ContextManager implements Serializable
             }
             }
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
-                LOGGER.error( SESSION_LABEL, "error trying to auto-import certs: " + e.getMessage() );
+                LOGGER.error( SESSION_LABEL, () -> "error trying to auto-import certs: " + e.getMessage() );
             }
             }
         }
         }
 
 

+ 8 - 8
server/src/main/java/password/pwm/http/HttpEventManager.java

@@ -75,7 +75,7 @@ public class HttpEventManager implements
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.warn( "error during sessionCreated event: " + e.getMessage() );
+            LOGGER.warn( () -> "error during sessionCreated event: " + e.getMessage() );
         }
         }
     }
     }
 
 
@@ -109,7 +109,7 @@ public class HttpEventManager implements
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.warn( "error during httpSessionDestroyed: " + e.getMessage() );
+            LOGGER.warn( () -> "error during httpSessionDestroyed: " + e.getMessage() );
         }
         }
     }
     }
 
 
@@ -120,7 +120,7 @@ public class HttpEventManager implements
 
 
         if ( null != servletContextEvent.getServletContext().getAttribute( PwmConstants.CONTEXT_ATTR_CONTEXT_MANAGER ) )
         if ( null != servletContextEvent.getServletContext().getAttribute( PwmConstants.CONTEXT_ATTR_CONTEXT_MANAGER ) )
         {
         {
-            LOGGER.warn( "notice, previous servlet ContextManager exists" );
+            LOGGER.warn( () -> "notice, previous servlet ContextManager exists" );
         }
         }
 
 
         try
         try
@@ -131,12 +131,12 @@ public class HttpEventManager implements
         }
         }
         catch ( final OutOfMemoryError e )
         catch ( final OutOfMemoryError e )
         {
         {
-            LOGGER.fatal( "JAVA OUT OF MEMORY ERROR!, please allocate more memory for java: " + e.getMessage(), e );
+            LOGGER.fatal( () -> "JAVA OUT OF MEMORY ERROR!, please allocate more memory for java: " + e.getMessage(), e );
             throw e;
             throw e;
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.fatal( "error initializing context: " + e, e );
+            LOGGER.fatal( () -> "error initializing context: " + e, e );
             System.err.println( "error initializing context: " + e );
             System.err.println( "error initializing context: " + e );
             System.out.println( "error initializing context: " + e );
             System.out.println( "error initializing context: " + e );
             e.printStackTrace();
             e.printStackTrace();
@@ -152,7 +152,7 @@ public class HttpEventManager implements
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.error( "unable to destroy context: " + e.getMessage() );
+            LOGGER.error( () -> "unable to destroy context: " + e.getMessage() );
         }
         }
     }
     }
 
 
@@ -166,7 +166,7 @@ public class HttpEventManager implements
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.error( "unable to passivate session: " + e.getMessage() );
+            LOGGER.error( () -> "unable to passivate session: " + e.getMessage() );
         }
         }
     }
     }
 
 
@@ -185,7 +185,7 @@ public class HttpEventManager implements
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.error( "unable to activate (de-passivate) session: " + e.getMessage() );
+            LOGGER.error( () -> "unable to activate (de-passivate) session: " + e.getMessage() );
         }
         }
     }
     }
 
 

+ 1 - 1
server/src/main/java/password/pwm/http/IdleTimeoutCalculator.java

@@ -240,7 +240,7 @@ public class IdleTimeoutCalculator
             }
             }
             catch ( final PwmUnrecoverableException e )
             catch ( final PwmUnrecoverableException e )
             {
             {
-                LOGGER.error( pwmRequest, "error while figuring max idle timeout for session: " + e.getMessage() );
+                LOGGER.error( pwmRequest, () -> "error while figuring max idle timeout for session: " + e.getMessage() );
             }
             }
         }
         }
 
 

+ 5 - 5
server/src/main/java/password/pwm/http/JspUtility.java

@@ -50,7 +50,7 @@ public abstract class JspUtility
         final PwmRequest pwmRequest = ( PwmRequest ) request.getAttribute( PwmRequestAttribute.PwmRequest.toString() );
         final PwmRequest pwmRequest = ( PwmRequest ) request.getAttribute( PwmRequestAttribute.PwmRequest.toString() );
         if ( pwmRequest == null )
         if ( pwmRequest == null )
         {
         {
-            LOGGER.warn( "unable to load pwmRequest object during jsp execution" );
+            LOGGER.warn( () -> "unable to load pwmRequest object during jsp execution" );
         }
         }
         return pwmRequest;
         return pwmRequest;
     }
     }
@@ -64,7 +64,7 @@ public abstract class JspUtility
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.warn( "unable to load pwmRequest object during jsp execution: " + e.getMessage() );
+            LOGGER.warn( () -> "unable to load pwmRequest object during jsp execution: " + e.getMessage() );
         }
         }
         return null;
         return null;
     }
     }
@@ -99,7 +99,7 @@ public abstract class JspUtility
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.warn( "unable to load pwmRequest object during jsp execution: " + e.getMessage() );
+            LOGGER.warn( () -> "unable to load pwmRequest object during jsp execution: " + e.getMessage() );
             return;
             return;
         }
         }
         if ( pwmRequest != null )
         if ( pwmRequest != null )
@@ -135,7 +135,7 @@ public abstract class JspUtility
             }
             }
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
-                LOGGER.warn( pwmRequest, "error reading number setting " + pwmSetting.getKey() + ", error: " + e.getMessage() );
+                LOGGER.warn( pwmRequest, () -> "error reading number setting " + pwmSetting.getKey() + ", error: " + e.getMessage() );
             }
             }
         }
         }
         return defaultValue;
         return defaultValue;
@@ -145,7 +145,7 @@ public abstract class JspUtility
     {
     {
         final PwmRequest pwmRequest = forRequest( pageContext.getRequest() );
         final PwmRequest pwmRequest = forRequest( pageContext.getRequest() );
         final PwmLogger logger = PwmLogger.getLogger( "jsp:" + pageContext.getPage().getClass() );
         final PwmLogger logger = PwmLogger.getLogger( "jsp:" + pageContext.getPage().getClass() );
-        logger.error( pwmRequest, message );
+        logger.error( pwmRequest, () -> message );
     }
     }
 
 
     public static String getMessage( final PageContext pageContext, final PwmDisplayBundle key )
     public static String getMessage( final PageContext pageContext, final PwmDisplayBundle key )

+ 1 - 1
server/src/main/java/password/pwm/http/PwmHttpRequestWrapper.java

@@ -418,7 +418,7 @@ public class PwmHttpRequestWrapper
         }
         }
         catch ( final UnsupportedEncodingException e )
         catch ( final UnsupportedEncodingException e )
         {
         {
-            LOGGER.error( "error decoding request parameter: " + e.getMessage() );
+            LOGGER.error( () -> "error decoding request parameter: " + e.getMessage() );
         }
         }
         return decodedValue;
         return decodedValue;
     }
     }

+ 2 - 2
server/src/main/java/password/pwm/http/PwmHttpResponseWrapper.java

@@ -159,7 +159,7 @@ public class PwmHttpResponseWrapper
     {
     {
         if ( this.getHttpServletResponse().isCommitted() )
         if ( this.getHttpServletResponse().isCommitted() )
         {
         {
-            LOGGER.warn( "attempt to write cookie '" + cookieName + "' after response is committed" );
+            LOGGER.warn( () -> "attempt to write cookie '" + cookieName + "' after response is committed" );
         }
         }
 
 
         final boolean secureFlag;
         final boolean secureFlag;
@@ -207,7 +207,7 @@ public class PwmHttpResponseWrapper
         theCookie.setPath( path == null ? CookiePath.CurrentURL.toStringPath( httpServletRequest ) : path.toStringPath( httpServletRequest ) );
         theCookie.setPath( path == null ? CookiePath.CurrentURL.toStringPath( httpServletRequest ) : path.toStringPath( httpServletRequest ) );
         if ( value != null && value.length() > 2000 )
         if ( value != null && value.length() > 2000 )
         {
         {
-            LOGGER.warn( "writing large cookie to response: cookieName=" + cookieName + ", length=" + value.length() );
+            LOGGER.warn( () -> "writing large cookie to response: cookieName=" + cookieName + ", length=" + value.length() );
         }
         }
         this.getHttpServletResponse().addCookie( theCookie );
         this.getHttpServletResponse().addCookie( theCookie );
         addSameSiteCookieAttribute();
         addSameSiteCookieAttribute();

+ 3 - 3
server/src/main/java/password/pwm/http/PwmRequest.java

@@ -245,7 +245,7 @@ public class PwmRequest extends PwmHttpRequestWrapper
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( "error reading file upload: " + e.getMessage() );
+            LOGGER.error( () -> "error reading file upload: " + e.getMessage() );
         }
         }
         return null;
         return null;
     }
     }
@@ -288,7 +288,7 @@ public class PwmRequest extends PwmHttpRequestWrapper
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( "error reading file upload: " + e.getMessage() );
+            LOGGER.error( () -> "error reading file upload: " + e.getMessage() );
         }
         }
         return Collections.unmodifiableMap( returnObj );
         return Collections.unmodifiableMap( returnObj );
     }
     }
@@ -329,7 +329,7 @@ public class PwmRequest extends PwmHttpRequestWrapper
         final String servletPath = this.getHttpServletRequest().getServletPath();
         final String servletPath = this.getHttpServletRequest().getServletPath();
         if ( !uri.contains( servletPath ) )
         if ( !uri.contains( servletPath ) )
         {
         {
-            LOGGER.error( "unexpected uri handler, uri '" + uri + "' does not contain servlet path '" + servletPath + "'" );
+            LOGGER.error( () -> "unexpected uri handler, uri '" + uri + "' does not contain servlet path '" + servletPath + "'" );
             return false;
             return false;
         }
         }
 
 

+ 3 - 3
server/src/main/java/password/pwm/http/PwmResponse.java

@@ -150,7 +150,7 @@ public class PwmResponse extends PwmHttpResponseWrapper
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.error( "unexpected error sending user to success page: " + e.toString() );
+            LOGGER.error( () -> "unexpected error sending user to success page: " + e.toString() );
         }
         }
     }
     }
 
 
@@ -179,7 +179,7 @@ public class PwmResponse extends PwmHttpResponseWrapper
         if ( isCommitted() )
         if ( isCommitted() )
         {
         {
             final String msg = "cannot respond with error '" + errorInformation.toDebugStr() + "', response is already committed";
             final String msg = "cannot respond with error '" + errorInformation.toDebugStr() + "', response is already committed";
-            LOGGER.warn( pwmRequest.getLabel(), ExceptionUtils.getStackTrace( new Throwable( msg ) ) );
+            LOGGER.warn( pwmRequest.getLabel(), () -> ExceptionUtils.getStackTrace( new Throwable( msg ) ) );
             return;
             return;
         }
         }
 
 
@@ -195,7 +195,7 @@ public class PwmResponse extends PwmHttpResponseWrapper
             }
             }
             catch ( final PwmUnrecoverableException e )
             catch ( final PwmUnrecoverableException e )
             {
             {
-                LOGGER.error( "unexpected error sending user to error page: " + e.toString() );
+                LOGGER.error( () -> "unexpected error sending user to error page: " + e.toString() );
             }
             }
         }
         }
         else
         else

+ 2 - 2
server/src/main/java/password/pwm/http/PwmSession.java

@@ -211,7 +211,7 @@ public class PwmSession implements Serializable
             }
             }
             catch ( final PwmUnrecoverableException e )
             catch ( final PwmUnrecoverableException e )
             {
             {
-                LOGGER.error( "unexpected error reading username: " + e.getMessage(), e );
+                LOGGER.error( () -> "unexpected error reading username: " + e.getMessage(), e );
             }
             }
         }
         }
 
 
@@ -341,7 +341,7 @@ public class PwmSession implements Serializable
         }
         }
         else
         else
         {
         {
-            LOGGER.error( pwmRequest, "ignoring unknown locale value set request for locale '" + localeString + "'" );
+            LOGGER.error( pwmRequest, () -> "ignoring unknown locale value set request for locale '" + localeString + "'" );
             ssBean.setLocale( PwmConstants.DEFAULT_LOCALE );
             ssBean.setLocale( PwmConstants.DEFAULT_LOCALE );
             return false;
             return false;
         }
         }

+ 1 - 1
server/src/main/java/password/pwm/http/PwmURL.java

@@ -467,7 +467,7 @@ public class PwmURL
                 }
                 }
                 catch ( final Exception e )
                 catch ( final Exception e )
                 {
                 {
-                    LOGGER.error( sessionLabel, "error while testing URL match for regex pattern: '" + loopFragment + "', error: " + e.getMessage() );
+                    LOGGER.error( sessionLabel, () -> "error while testing URL match for regex pattern: '" + loopFragment + "', error: " + e.getMessage() );
                 }
                 }
 
 
             }
             }

+ 1 - 1
server/src/main/java/password/pwm/http/SessionManager.java

@@ -137,7 +137,7 @@ public class SessionManager
             }
             }
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
-                LOGGER.error( pwmSession.getLabel(), "error while closing user connection: " + e.getMessage() );
+                LOGGER.error( pwmSession.getLabel(), () -> "error while closing user connection: " + e.getMessage() );
             }
             }
         }
         }
     }
     }

+ 9 - 9
server/src/main/java/password/pwm/http/auth/CASFilterAuthenticationProvider.java

@@ -190,7 +190,7 @@ public class CASFilterAuthenticationProvider implements PwmHttpFilterAuthenticat
             }
             }
             catch ( final MalformedURLException e )
             catch ( final MalformedURLException e )
             {
             {
-                LOGGER.error( pwmRequest, "Invalid CAS clearPassUrl" );
+                LOGGER.error( pwmRequest, () -> "Invalid CAS clearPassUrl" );
             }
             }
 
 
         }
         }
@@ -249,44 +249,44 @@ public class CASFilterAuthenticationProvider implements PwmHttpFilterAuthenticat
                     }
                     }
                     catch ( final PwmUnrecoverableException e )
                     catch ( final PwmUnrecoverableException e )
                     {
                     {
-                        LOGGER.error( "Decryption failed", e );
+                        LOGGER.error( () -> "Decryption failed", e );
                         return password;
                         return password;
                     }
                     }
                 }
                 }
             }
             }
             catch ( final NoSuchAlgorithmException e1 )
             catch ( final NoSuchAlgorithmException e1 )
             {
             {
-                LOGGER.error( "Decryption failed", e1 );
+                LOGGER.error( () -> "Decryption failed", e1 );
                 return password;
                 return password;
             }
             }
             catch ( final InvalidKeySpecException e1 )
             catch ( final InvalidKeySpecException e1 )
             {
             {
-                LOGGER.error( "Decryption failed", e1 );
+                LOGGER.error( () -> "Decryption failed", e1 );
                 return password;
                 return password;
             }
             }
             catch ( final NoSuchPaddingException e1 )
             catch ( final NoSuchPaddingException e1 )
             {
             {
-                LOGGER.error( "Decryption failed", e1 );
+                LOGGER.error( () -> "Decryption failed", e1 );
                 return password;
                 return password;
             }
             }
             catch ( final IOException e1 )
             catch ( final IOException e1 )
             {
             {
-                LOGGER.error( "Decryption failed", e1 );
+                LOGGER.error( () -> "Decryption failed", e1 );
                 return password;
                 return password;
             }
             }
             catch ( final InvalidKeyException e1 )
             catch ( final InvalidKeyException e1 )
             {
             {
-                LOGGER.error( "Decryption failed", e1 );
+                LOGGER.error( () -> "Decryption failed", e1 );
                 return password;
                 return password;
             }
             }
             catch ( final IllegalBlockSizeException e )
             catch ( final IllegalBlockSizeException e )
             {
             {
-                LOGGER.error( "Decryption failed", e );
+                LOGGER.error( () -> "Decryption failed", e );
                 return password;
                 return password;
             }
             }
             catch ( final BadPaddingException e )
             catch ( final BadPaddingException e )
             {
             {
-                LOGGER.error( "Decryption failed", e );
+                LOGGER.error( () -> "Decryption failed", e );
                 return password;
                 return password;
             }
             }
         }
         }

+ 1 - 1
server/src/main/java/password/pwm/http/auth/HttpAuthenticationUtilities.java

@@ -151,7 +151,7 @@ public abstract class HttpAuthenticationUtilities
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.error( pwmRequest, "error while setting authentication record cookie: " + e.getMessage() );
+            LOGGER.error( pwmRequest, () -> "error while setting authentication record cookie: " + e.getMessage() );
         }
         }
     }
     }
 
 

+ 2 - 7
server/src/main/java/password/pwm/http/bean/SetupOtpBean.java

@@ -92,15 +92,10 @@ public class SetupOtpBean extends PwmSessionBean
             {
             {
                 random = SecureRandom.getInstance( "SHA1PRNG", "SUN" );
                 random = SecureRandom.getInstance( "SHA1PRNG", "SUN" );
             }
             }
-            catch ( final NoSuchAlgorithmException ex )
+            catch ( final NoSuchAlgorithmException | NoSuchProviderException ex )
             {
             {
                 random = new SecureRandom();
                 random = new SecureRandom();
-                LOGGER.error( ex.getMessage(), ex );
-            }
-            catch ( final NoSuchProviderException ex )
-            {
-                random = new SecureRandom();
-                LOGGER.error( ex.getMessage(), ex );
+                LOGGER.error( () -> ex.getMessage(), ex );
             }
             }
             random.setSeed( ( new Date() ).getTime() );
             random.setSeed( ( new Date() ).getTime() );
             challenge = random.nextLong() % ( 10 ^ 6 );
             challenge = random.nextLong() % ( 10 ^ 6 );

+ 3 - 3
server/src/main/java/password/pwm/http/filter/AbstractPwmFilter.java

@@ -67,7 +67,7 @@ public abstract class AbstractPwmFilter implements Filter
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( "unexpected error processing filter chain during isInterested(): " + e.getMessage(), e );
+            LOGGER.error( () -> "unexpected error processing filter chain during isInterested(): " + e.getMessage(), e );
             resp.sendError( 500, "unexpected error processing filter chain during isInterested" );
             resp.sendError( 500, "unexpected error processing filter chain during isInterested" );
             return;
             return;
         }
         }
@@ -88,7 +88,7 @@ public abstract class AbstractPwmFilter implements Filter
                     return;
                     return;
                 }
                 }
 
 
-                LOGGER.error( pwmRequest, "unexpected error processing filter chain: " + e.getMessage(), e );
+                LOGGER.error( pwmRequest, () -> "unexpected error processing filter chain: " + e.getMessage(), e );
             }
             }
 
 
             try
             try
@@ -98,7 +98,7 @@ public abstract class AbstractPwmFilter implements Filter
             }
             }
             catch ( final PwmException e )
             catch ( final PwmException e )
             {
             {
-                LOGGER.error( pwmRequest, "unexpected error processing filter chain: " + e.getMessage(), e );
+                LOGGER.error( pwmRequest, () -> "unexpected error processing filter chain: " + e.getMessage(), e );
             }
             }
             catch ( final  IOException e )
             catch ( final  IOException e )
             {
             {

+ 1 - 1
server/src/main/java/password/pwm/http/filter/ApplicationModeFilter.java

@@ -67,7 +67,7 @@ public class ApplicationModeFilter extends AbstractPwmFilter
                 {
                 {
                     try
                     try
                     {
                     {
-                        LOGGER.error( e.getMessage() );
+                        LOGGER.error( () -> e.getMessage() );
                     }
                     }
                     catch ( final Exception ignore )
                     catch ( final Exception ignore )
                     {
                     {

+ 1 - 1
server/src/main/java/password/pwm/http/filter/AuthenticationFilter.java

@@ -199,7 +199,7 @@ public class AuthenticationFilter extends AbstractPwmFilter
                 }
                 }
                 catch ( final Throwable e1 )
                 catch ( final Throwable e1 )
                 {
                 {
-                    LOGGER.error( "error while marking pre-login url:" + e1.getMessage() );
+                    LOGGER.error( () -> "error while marking pre-login url:" + e1.getMessage() );
                 }
                 }
             }
             }
         }
         }

+ 2 - 2
server/src/main/java/password/pwm/http/filter/AuthorizationFilter.java

@@ -74,7 +74,7 @@ public class AuthorizationFilter extends AbstractPwmFilter
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.warn( pwmRequest, "error during authorization check: " + e.getMessage() );
+            LOGGER.warn( pwmRequest, () -> "error during authorization check: " + e.getMessage() );
         }
         }
 
 
         try
         try
@@ -87,7 +87,7 @@ public class AuthorizationFilter extends AbstractPwmFilter
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.warn( pwmRequest, "unexpected error executing filter chain: " + e.getMessage() );
+            LOGGER.warn( pwmRequest, () -> "unexpected error executing filter chain: " + e.getMessage() );
             return;
             return;
         }
         }
 
 

+ 2 - 2
server/src/main/java/password/pwm/http/filter/GZIPFilter.java

@@ -59,7 +59,7 @@ public class GZIPFilter implements Filter
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.warn( "unable to load application configuration, defaulting to disabled" );
+            LOGGER.warn( () -> "unable to load application configuration, defaulting to disabled" );
         }
         }
 
 
         compressingFilter.init( filterConfig );
         compressingFilter.init( filterConfig );
@@ -98,7 +98,7 @@ public class GZIPFilter implements Filter
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( "unable to parse request url, defaulting to non-gzip: " + e.getMessage() );
+            LOGGER.error( () -> "unable to parse request url, defaulting to non-gzip: " + e.getMessage() );
         }
         }
 
 
         return true;
         return true;

+ 9 - 9
server/src/main/java/password/pwm/http/filter/RequestInitializationFilter.java

@@ -150,10 +150,10 @@ public class RequestInitializationFilter implements Filter
                     return;
                     return;
                 }
                 }
 
 
-                LOGGER.error( "error while trying to detect application status: " + e.getMessage() );
+                LOGGER.error( () -> "error while trying to detect application status: " + e.getMessage() );
             }
             }
 
 
-            LOGGER.error( "unable to satisfy incoming request, application is not available" );
+            LOGGER.error( () -> "unable to satisfy incoming request, application is not available" );
             resp.setStatus( 500 );
             resp.setStatus( 500 );
             final String url = JspUrl.APP_UNAVAILABLE.getPath();
             final String url = JspUrl.APP_UNAVAILABLE.getPath();
             servletRequest.getServletContext().getRequestDispatcher( url ).forward( servletRequest, servletResponse );
             servletRequest.getServletContext().getRequestDispatcher( url ).forward( servletRequest, servletResponse );
@@ -185,7 +185,7 @@ public class RequestInitializationFilter implements Filter
         }
         }
         catch ( final Throwable e )
         catch ( final Throwable e )
         {
         {
-            LOGGER.error( "can't load application: " + e.getMessage(), e );
+            LOGGER.error( () -> "can't load application: " + e.getMessage(), e );
             if ( !( new PwmURL( req ).isResourceURL() ) )
             if ( !( new PwmURL( req ).isResourceURL() ) )
             {
             {
                 respondWithUnavailableError( req, resp );
                 respondWithUnavailableError( req, resp );
@@ -227,11 +227,11 @@ public class RequestInitializationFilter implements Filter
             final String logMsg = "can't init request: " + e.getMessage();
             final String logMsg = "can't init request: " + e.getMessage();
             if ( e instanceof PwmException && ( ( PwmException ) e ).getError() != PwmError.ERROR_INTERNAL )
             if ( e instanceof PwmException && ( ( PwmException ) e ).getError() != PwmError.ERROR_INTERNAL )
             {
             {
-                LOGGER.error( logMsg );
+                LOGGER.error( () -> logMsg );
             }
             }
             else
             else
             {
             {
-                LOGGER.error( logMsg, e );
+                LOGGER.error( () -> logMsg, e );
             }
             }
             if ( !( new PwmURL( req ).isResourceURL() ) )
             if ( !( new PwmURL( req ).isResourceURL() ) )
             {
             {
@@ -258,7 +258,7 @@ public class RequestInitializationFilter implements Filter
         }
         }
         catch ( final PwmUnrecoverableException e2 )
         catch ( final PwmUnrecoverableException e2 )
         {
         {
-            LOGGER.error( "error reading session context from servlet container: " + e2.getMessage() );
+            LOGGER.error( () -> "error reading session context from servlet container: " + e2.getMessage() );
         }
         }
 
 
         req.setAttribute( PwmRequestAttribute.PwmErrorInfo.toString(), errorInformation );
         req.setAttribute( PwmRequestAttribute.PwmErrorInfo.toString(), errorInformation );
@@ -488,7 +488,7 @@ public class RequestInitializationFilter implements Filter
             }
             }
             else
             else
             {
             {
-                LOGGER.warn( "discarding bogus source network address '" + trimAddr + "'" );
+                LOGGER.warn( () -> "discarding bogus source network address '" + trimAddr + "'" );
             }
             }
         }
         }
 
 
@@ -692,12 +692,12 @@ public class RequestInitializationFilter implements Filter
                     }
                     }
                     catch ( final IPMatcher.IPMatcherException e )
                     catch ( final IPMatcher.IPMatcherException e )
                     {
                     {
-                        LOGGER.error( "error while attempting to match permitted address range '" + ipMatchString + "', error: " + e );
+                        LOGGER.error( () -> "error while attempting to match permitted address range '" + ipMatchString + "', error: " + e );
                     }
                     }
                 }
                 }
                 catch ( final IPMatcher.IPMatcherException e )
                 catch ( final IPMatcher.IPMatcherException e )
                 {
                 {
-                    LOGGER.error( "error parsing permitted address range '" + ipMatchString + "', error: " + e );
+                    LOGGER.error( () -> "error parsing permitted address range '" + ipMatchString + "', error: " + e );
                 }
                 }
             }
             }
             if ( !match )
             if ( !match )

+ 4 - 4
server/src/main/java/password/pwm/http/filter/SessionFilter.java

@@ -129,7 +129,7 @@ public class SessionFilter extends AbstractPwmFilter
             }
             }
             else
             else
             {
             {
-                LOGGER.error( pwmRequest, "unhandled exception " + e.getMessage(), e );
+                LOGGER.error( pwmRequest, () -> "unhandled exception " + e.getMessage(), e );
             }
             }
 
 
             throw new ServletException( e );
             throw new ServletException( e );
@@ -168,7 +168,7 @@ public class SessionFilter extends AbstractPwmFilter
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.warn( pwmRequest, "error while reading login session state: " + e.getMessage() );
+            LOGGER.warn( pwmRequest, () -> "error while reading login session state: " + e.getMessage() );
         }
         }
 
 
         // mark last url
         // mark last url
@@ -184,7 +184,7 @@ public class SessionFilter extends AbstractPwmFilter
         // check the page leave notice
         // check the page leave notice
         if ( checkPageLeaveNotice( pwmSession, config ) )
         if ( checkPageLeaveNotice( pwmSession, config ) )
         {
         {
-            LOGGER.warn( "invalidating session due to dirty page leave time greater then configured timeout" );
+            LOGGER.warn( () -> "invalidating session due to dirty page leave time greater then configured timeout" );
             pwmRequest.invalidateSession();
             pwmRequest.invalidateSession();
             resp.sendRedirect( pwmRequest.getHttpServletRequest().getRequestURI() );
             resp.sendRedirect( pwmRequest.getHttpServletRequest().getRequestURI() );
             return ProcessStatus.Halt;
             return ProcessStatus.Halt;
@@ -546,7 +546,7 @@ public class SessionFilter extends AbstractPwmFilter
         }
         }
         catch ( final IllegalArgumentException e )
         catch ( final IllegalArgumentException e )
         {
         {
-            LOGGER.error( sessionLabel, "unable to parse requested redirect url '" + inputURL + "', error: " + e.getMessage() );
+            LOGGER.error( sessionLabel, () -> "unable to parse requested redirect url '" + inputURL + "', error: " + e.getMessage() );
             // dont put input uri in error response
             // dont put input uri in error response
             final String errorMsg = "unable to parse url: " + e.getMessage();
             final String errorMsg = "unable to parse url: " + e.getMessage();
             throw new PwmOperationalException( new ErrorInformation( PwmError.ERROR_REDIRECT_ILLEGAL, errorMsg ) );
             throw new PwmOperationalException( new ErrorInformation( PwmError.ERROR_REDIRECT_ILLEGAL, errorMsg ) );

+ 8 - 8
server/src/main/java/password/pwm/http/servlet/AbstractPwmServlet.java

@@ -98,7 +98,7 @@ public abstract class AbstractPwmServlet extends HttpServlet implements PwmServl
                     {
                     {
                         final ErrorInformation errorInformation = e.getErrorInformation();
                         final ErrorInformation errorInformation = e.getErrorInformation();
                         final PwmSession pwmSession = PwmSessionWrapper.readPwmSession( req );
                         final PwmSession pwmSession = PwmSessionWrapper.readPwmSession( req );
-                        LOGGER.error( pwmRequest, errorInformation.toDebugStr() );
+                        LOGGER.error( pwmRequest, () -> errorInformation.toDebugStr() );
                         pwmRequest.respondWithError( errorInformation, false );
                         pwmRequest.respondWithError( errorInformation, false );
                         return;
                         return;
                     }
                     }
@@ -114,7 +114,7 @@ public abstract class AbstractPwmServlet extends HttpServlet implements PwmServl
                 {
                 {
                     final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_SERVICE_NOT_AVAILABLE,
                     final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_SERVICE_NOT_AVAILABLE,
                             "incorrect request method " + method.toString() + " on request to " + pwmRequest.getURLwithQueryString() );
                             "incorrect request method " + method.toString() + " on request to " + pwmRequest.getURLwithQueryString() );
-                    LOGGER.error( pwmRequest, errorInformation.toDebugStr() );
+                    LOGGER.error( pwmRequest, () -> errorInformation.toDebugStr() );
                     pwmRequest.respondWithError( errorInformation, false );
                     pwmRequest.respondWithError( errorInformation, false );
                     return;
                     return;
                 }
                 }
@@ -134,7 +134,7 @@ public abstract class AbstractPwmServlet extends HttpServlet implements PwmServl
                 try
                 try
                 {
                 {
                     LOGGER.fatal(
                     LOGGER.fatal(
-                            "exception occurred, but exception handler unable to load request instance; error=" + e.getMessage(),
+                            () -> "exception occurred, but exception handler unable to load request instance; error=" + e.getMessage(),
                             e );
                             e );
                 }
                 }
                 catch ( final Exception e3 )
                 catch ( final Exception e3 )
@@ -211,7 +211,7 @@ public abstract class AbstractPwmServlet extends HttpServlet implements PwmServl
         }
         }
         final String errorMsg = "unexpected error processing request: " + JavaHelper.readHostileExceptionMessage( e ) + " [" + stackTraceHash + "]";
         final String errorMsg = "unexpected error processing request: " + JavaHelper.readHostileExceptionMessage( e ) + " [" + stackTraceHash + "]";
 
 
-        LOGGER.error( pwmRequest, errorMsg, e );
+        LOGGER.error( pwmRequest, () -> errorMsg, e );
         return new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_INTERNAL, errorMsg ) );
         return new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_INTERNAL, errorMsg ) );
     }
     }
 
 
@@ -228,7 +228,7 @@ public abstract class AbstractPwmServlet extends HttpServlet implements PwmServl
         switch ( e.getError() )
         switch ( e.getError() )
         {
         {
             case ERROR_DIRECTORY_UNAVAILABLE:
             case ERROR_DIRECTORY_UNAVAILABLE:
-                LOGGER.fatal( pwmRequest.getLabel(), e.getErrorInformation().toDebugStr() );
+                LOGGER.fatal( pwmRequest.getLabel(), () -> e.getErrorInformation().toDebugStr() );
                 try
                 try
                 {
                 {
                     pwmApplication.getStatisticsManager().incrementValue( Statistic.LDAP_UNAVAILABLE_COUNT );
                     pwmApplication.getStatisticsManager().incrementValue( Statistic.LDAP_UNAVAILABLE_COUNT );
@@ -242,7 +242,7 @@ public abstract class AbstractPwmServlet extends HttpServlet implements PwmServl
 
 
             case ERROR_PASSWORD_REQUIRED:
             case ERROR_PASSWORD_REQUIRED:
                 LOGGER.warn(
                 LOGGER.warn(
-                        "attempt to access functionality requiring password authentication, but password not yet supplied by actor, forwarding to password Login page" );
+                        () -> "attempt to access functionality requiring password authentication, but password not yet supplied by actor, forwarding to password Login page" );
                 //store the original requested url
                 //store the original requested url
                 try
                 try
                 {
                 {
@@ -252,14 +252,14 @@ public abstract class AbstractPwmServlet extends HttpServlet implements PwmServl
                 }
                 }
                 catch ( final Throwable e1 )
                 catch ( final Throwable e1 )
                 {
                 {
-                    LOGGER.error( "error while marking pre-login url:" + e1.getMessage() );
+                    LOGGER.error( () -> "error while marking pre-login url:" + e1.getMessage() );
                 }
                 }
                 break;
                 break;
 
 
 
 
             case ERROR_INTERNAL:
             case ERROR_INTERNAL:
             default:
             default:
-                LOGGER.fatal( pwmRequest.getLabel(), "unexpected error: " + e.getErrorInformation().toDebugStr() );
+                LOGGER.fatal( pwmRequest.getLabel(), () -> "unexpected error: " + e.getErrorInformation().toDebugStr() );
                 try
                 try
                 {
                 {
                     // try to update stats
                     // try to update stats

+ 3 - 3
server/src/main/java/password/pwm/http/servlet/ClientApiServlet.java

@@ -322,7 +322,7 @@ public class ClientApiServlet extends ControlledPwmServlet
             long idleSeconds = config.readSettingAsLong( PwmSetting.IDLE_TIMEOUT_SECONDS );
             long idleSeconds = config.readSettingAsLong( PwmSetting.IDLE_TIMEOUT_SECONDS );
             if ( pageUrl == null || pageUrl.isEmpty() )
             if ( pageUrl == null || pageUrl.isEmpty() )
             {
             {
-                LOGGER.warn( pwmRequest, "request to /client data did not include pageUrl" );
+                LOGGER.warn( pwmRequest, () -> "request to /client data did not include pageUrl" );
             }
             }
             else
             else
             {
             {
@@ -334,7 +334,7 @@ public class ClientApiServlet extends ControlledPwmServlet
                 }
                 }
                 catch ( final Exception e )
                 catch ( final Exception e )
                 {
                 {
-                    LOGGER.error( pwmRequest, "error determining idle timeout time for request: " + e.getMessage() );
+                    LOGGER.error( pwmRequest, () -> "error determining idle timeout time for request: " + e.getMessage() );
                 }
                 }
             }
             }
             settingMap.put( "MaxInactiveInterval", idleSeconds );
             settingMap.put( "MaxInactiveInterval", idleSeconds );
@@ -441,7 +441,7 @@ public class ClientApiServlet extends ControlledPwmServlet
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( pwmRequest, "error expanding macro display value: " + e.getMessage() );
+            LOGGER.error( pwmRequest, () -> "error expanding macro display value: " + e.getMessage() );
         }
         }
         return displayStrings;
         return displayStrings;
     }
     }

+ 6 - 6
server/src/main/java/password/pwm/http/servlet/ControlledPwmServlet.java

@@ -94,7 +94,7 @@ public abstract class ControlledPwmServlet extends AbstractPwmServlet implements
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( "error", e );
+            LOGGER.error( () -> "error", e );
         }
         }
         return null;
         return null;
     }
     }
@@ -131,20 +131,20 @@ public abstract class ControlledPwmServlet extends AbstractPwmServlet implements
                 final String msg = "unexpected error during action handler for '"
                 final String msg = "unexpected error during action handler for '"
                         + this.getClass().getName()
                         + this.getClass().getName()
                         + ":" + action + "', error: " + cause.getMessage();
                         + ":" + action + "', error: " + cause.getMessage();
-                LOGGER.error( pwmRequest, msg, e.getCause() );
+                LOGGER.error( pwmRequest, () -> msg, e.getCause() );
                 throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_INTERNAL, msg ) );
                 throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_INTERNAL, msg ) );
             }
             }
-            LOGGER.error( "uncased invocation error: " + e.getMessage(), e );
+            LOGGER.error( () -> "uncased invocation error: " + e.getMessage(), e );
         }
         }
         catch ( final Throwable e )
         catch ( final Throwable e )
         {
         {
             final String msg = "unexpected error invoking action handler for '" + action + "', error: " + e.getMessage();
             final String msg = "unexpected error invoking action handler for '" + action + "', error: " + e.getMessage();
-            LOGGER.error( msg, e );
+            LOGGER.error( () -> msg, e );
             throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_INTERNAL, msg ) );
             throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_INTERNAL, msg ) );
         }
         }
 
 
         final String msg = "missing action handler for '" + action + "'";
         final String msg = "missing action handler for '" + action + "'";
-        LOGGER.error( msg );
+        LOGGER.error( () -> msg );
         throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_INTERNAL, msg ) );
         throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_INTERNAL, msg ) );
     }
     }
 
 
@@ -164,7 +164,7 @@ public abstract class ControlledPwmServlet extends AbstractPwmServlet implements
                     if ( pwmRequest.getConfig().isDevDebugMode() )
                     if ( pwmRequest.getConfig().isDevDebugMode() )
                     {
                     {
                         final String msg = "processing complete, handler returned halt but response is not committed";
                         final String msg = "processing complete, handler returned halt but response is not committed";
-                        LOGGER.error( pwmRequest, msg, new IllegalStateException( msg ) );
+                        LOGGER.error( pwmRequest, () -> msg, new IllegalStateException( msg ) );
                     }
                     }
                 }
                 }
                 return;
                 return;

+ 2 - 2
server/src/main/java/password/pwm/http/servlet/DeleteAccountServlet.java

@@ -219,7 +219,7 @@ public class DeleteAccountServlet extends ControlledPwmServlet
                 }
                 }
                 catch ( final PwmOperationalException e )
                 catch ( final PwmOperationalException e )
                 {
                 {
-                    LOGGER.error( "error during user delete action execution: " + e.getMessage() );
+                    LOGGER.error( () -> "error during user delete action execution: " + e.getMessage() );
                     throw new PwmUnrecoverableException( e.getErrorInformation(), e.getCause() );
                     throw new PwmUnrecoverableException( e.getErrorInformation(), e.getCause() );
                 }
                 }
             }
             }
@@ -251,7 +251,7 @@ public class DeleteAccountServlet extends ControlledPwmServlet
             catch ( final ChaiException e )
             catch ( final ChaiException e )
             {
             {
                 final PwmUnrecoverableException pwmException = PwmUnrecoverableException.fromChaiException( e );
                 final PwmUnrecoverableException pwmException = PwmUnrecoverableException.fromChaiException( e );
-                LOGGER.error( "error during user delete", pwmException );
+                LOGGER.error( () -> "error during user delete", pwmException );
                 throw pwmException;
                 throw pwmException;
             }
             }
         }
         }

+ 4 - 4
server/src/main/java/password/pwm/http/servlet/GuestRegistrationServlet.java

@@ -199,7 +199,7 @@ public class GuestRegistrationServlet extends AbstractPwmServlet
         }
         }
         catch ( final IllegalArgumentException e )
         catch ( final IllegalArgumentException e )
         {
         {
-            LOGGER.error( pwmRequest, "unknown page select request: " + requestedPage );
+            LOGGER.error( pwmRequest, () -> "unknown page select request: " + requestedPage );
         }
         }
         this.forwardToJSP( pwmRequest, guestRegistrationBean );
         this.forwardToJSP( pwmRequest, guestRegistrationBean );
     }
     }
@@ -270,7 +270,7 @@ public class GuestRegistrationServlet extends AbstractPwmServlet
         }
         }
         catch ( final PwmOperationalException e )
         catch ( final PwmOperationalException e )
         {
         {
-            LOGGER.error( pwmRequest, e.getErrorInformation().toDebugStr() );
+            LOGGER.error( pwmRequest, () -> e.getErrorInformation().toDebugStr() );
             setLastError( pwmRequest, e.getErrorInformation() );
             setLastError( pwmRequest, e.getErrorInformation() );
         }
         }
         catch ( final ChaiOperationException e )
         catch ( final ChaiOperationException e )
@@ -392,7 +392,7 @@ public class GuestRegistrationServlet extends AbstractPwmServlet
             }
             }
             catch ( final PwmUnrecoverableException e )
             catch ( final PwmUnrecoverableException e )
             {
             {
-                LOGGER.warn( pwmRequest, "error reading current attributes for user: " + e.getMessage() );
+                LOGGER.warn( pwmRequest, () -> "error reading current attributes for user: " + e.getMessage() );
             }
             }
         }
         }
         catch ( final PwmOperationalException e )
         catch ( final PwmOperationalException e )
@@ -518,7 +518,7 @@ public class GuestRegistrationServlet extends AbstractPwmServlet
         }
         }
         catch ( final PwmOperationalException e )
         catch ( final PwmOperationalException e )
         {
         {
-            LOGGER.error( pwmRequest, e.getErrorInformation().toDebugStr() );
+            LOGGER.error( pwmRequest, () -> e.getErrorInformation().toDebugStr() );
             setLastError( pwmRequest, e.getErrorInformation() );
             setLastError( pwmRequest, e.getErrorInformation() );
             this.forwardToJSP( pwmRequest, guestRegistrationBean );
             this.forwardToJSP( pwmRequest, guestRegistrationBean );
         }
         }

+ 7 - 7
server/src/main/java/password/pwm/http/servlet/SetupOtpServlet.java

@@ -142,14 +142,14 @@ public class SetupOtpServlet extends ControlledPwmServlet
         // check whether the setup can be stored
         // check whether the setup can be stored
         if ( !canSetupOtpSecret( config ) )
         if ( !canSetupOtpSecret( config ) )
         {
         {
-            LOGGER.error( pwmRequest, "OTP Secret cannot be setup" );
+            LOGGER.error( pwmRequest, () -> "OTP Secret cannot be setup" );
             pwmRequest.respondWithError( PwmError.ERROR_INVALID_CONFIG.toInfo() );
             pwmRequest.respondWithError( PwmError.ERROR_INVALID_CONFIG.toInfo() );
             return ProcessStatus.Halt;
             return ProcessStatus.Halt;
         }
         }
 
 
         if ( pwmSession.getLoginInfoBean().getType() == AuthenticationType.AUTH_WITHOUT_PASSWORD )
         if ( pwmSession.getLoginInfoBean().getType() == AuthenticationType.AUTH_WITHOUT_PASSWORD )
         {
         {
-            LOGGER.error( pwmRequest, "OTP Secret requires a password login" );
+            LOGGER.error( pwmRequest, () -> "OTP Secret requires a password login" );
             throw new PwmUnrecoverableException( PwmError.ERROR_PASSWORD_REQUIRED );
             throw new PwmUnrecoverableException( PwmError.ERROR_PASSWORD_REQUIRED );
         }
         }
 
 
@@ -213,7 +213,7 @@ public class SetupOtpServlet extends ControlledPwmServlet
                 {
                 {
                     errorInformation = new ErrorInformation( PwmError.ERROR_WRITING_OTP_SECRET, "unexpected error saving otp secret: " + e.getMessage() );
                     errorInformation = new ErrorInformation( PwmError.ERROR_WRITING_OTP_SECRET, "unexpected error saving otp secret: " + e.getMessage() );
                 }
                 }
-                LOGGER.error( pwmRequest, errorInformation.toDebugStr() );
+                LOGGER.error( pwmRequest, () -> errorInformation.toDebugStr() );
                 setLastError( pwmRequest, errorInformation );
                 setLastError( pwmRequest, errorInformation );
             }
             }
         }
         }
@@ -307,7 +307,7 @@ public class SetupOtpServlet extends ControlledPwmServlet
         {
         {
 
 
             final String errorMsg = "error during otp code validation: " + e.getMessage();
             final String errorMsg = "error during otp code validation: " + e.getMessage();
-            LOGGER.error( pwmRequest, errorMsg );
+            LOGGER.error( pwmRequest, () -> errorMsg );
             pwmRequest.outputJsonResult( RestResultBean.fromError( new ErrorInformation( PwmError.ERROR_INTERNAL, errorMsg ), pwmRequest ) );
             pwmRequest.outputJsonResult( RestResultBean.fromError( new ErrorInformation( PwmError.ERROR_INTERNAL, errorMsg ), pwmRequest ) );
         }
         }
 
 
@@ -384,7 +384,7 @@ public class SetupOtpServlet extends ControlledPwmServlet
             }
             }
             catch ( final PwmOperationalException e )
             catch ( final PwmOperationalException e )
             {
             {
-                LOGGER.error( pwmRequest, "error validating otp token: " + e.getMessage() );
+                LOGGER.error( pwmRequest, () -> "error validating otp token: " + e.getMessage() );
                 setLastError( pwmRequest, e.getErrorInformation() );
                 setLastError( pwmRequest, e.getErrorInformation() );
             }
             }
         }
         }
@@ -459,7 +459,7 @@ public class SetupOtpServlet extends ControlledPwmServlet
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
                 final String errorMsg = "error setting up new OTP secret: " + e.getMessage();
                 final String errorMsg = "error setting up new OTP secret: " + e.getMessage();
-                LOGGER.error( pwmRequest, errorMsg );
+                LOGGER.error( pwmRequest, () -> errorMsg );
                 throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_INTERNAL, errorMsg ) );
                 throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_INTERNAL, errorMsg ) );
             }
             }
         }
         }
@@ -508,7 +508,7 @@ public class SetupOtpServlet extends ControlledPwmServlet
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
             final String errorMsg = "error generating qrcode image: " + e.getMessage() + ", payload length=" + qrCodeContent.length();
             final String errorMsg = "error generating qrcode image: " + e.getMessage() + ", payload length=" + qrCodeContent.length();
-            LOGGER.error( pwmRequest, errorMsg, e );
+            LOGGER.error( pwmRequest, () -> errorMsg, e );
             throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_INTERNAL, errorMsg ) );
             throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_INTERNAL, errorMsg ) );
         }
         }
 
 

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/ShortcutServlet.java

@@ -223,7 +223,7 @@ public class ShortcutServlet extends AbstractPwmServlet
             return;
             return;
         }
         }
 
 
-        LOGGER.error( pwmRequest, "unknown/unexpected link requested to " + link );
+        LOGGER.error( pwmRequest, () -> "unknown/unexpected link requested to " + link );
         pwmRequest.forwardToJsp( JspUrl.SHORTCUT );
         pwmRequest.forwardToJsp( JspUrl.SHORTCUT );
     }
     }
 }
 }

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/accountinfo/AccountInformationServlet.java

@@ -92,7 +92,7 @@ public class AccountInformationServlet extends ControlledPwmServlet
         }
         }
         catch ( final PwmException e )
         catch ( final PwmException e )
         {
         {
-            LOGGER.error( pwmRequest, "error reading user form data: " + e.getMessage() );
+            LOGGER.error( pwmRequest, () -> "error reading user form data: " + e.getMessage() );
         }
         }
 
 
         pwmRequest.forwardToJsp( JspUrl.ACCOUNT_INFORMATION );
         pwmRequest.forwardToJsp( JspUrl.ACCOUNT_INFORMATION );

+ 2 - 2
server/src/main/java/password/pwm/http/servlet/activation/ActivateUserUtils.java

@@ -187,7 +187,7 @@ class ActivateUserUtils
                 }
                 }
                 catch ( final ChaiOperationException e )
                 catch ( final ChaiOperationException e )
                 {
                 {
-                    LOGGER.error( pwmRequest, "error during param validation of '" + attrName + "', error: " + e.getMessage() );
+                    LOGGER.error( pwmRequest, () -> "error during param validation of '" + attrName + "', error: " + e.getMessage() );
                     throw new PwmDataValidationException( new ErrorInformation(
                     throw new PwmDataValidationException( new ErrorInformation(
                             PwmError.ERROR_ACTIVATION_VALIDATIONFAIL,
                             PwmError.ERROR_ACTIVATION_VALIDATIONFAIL,
                             "ldap error testing value for '" + attrName + "'", new String[]
                             "ldap error testing value for '" + attrName + "'", new String[]
@@ -225,7 +225,7 @@ class ActivateUserUtils
         }
         }
         if ( !success )
         if ( !success )
         {
         {
-            LOGGER.warn( pwmRequest, "skipping send activation message for '" + userInfo.getUserIdentity() + "' no email or SMS number configured" );
+            LOGGER.warn( pwmRequest, () -> "skipping send activation message for '" + userInfo.getUserIdentity() + "' no email or SMS number configured" );
         }
         }
     }
     }
 
 

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/admin/AppDashboardData.java

@@ -415,7 +415,7 @@ public class AppDashboardData implements Serializable
         }
         }
         catch ( final LocalDBException e )
         catch ( final LocalDBException e )
         {
         {
-            LOGGER.error( "error making localDB size bean: " + e.getMessage() );
+            LOGGER.error( () -> "error making localDB size bean: " + e.getMessage() );
         }
         }
         return Collections.unmodifiableMap( returnData );
         return Collections.unmodifiableMap( returnData );
     }
     }

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/changepw/ChangePasswordServlet.java

@@ -368,7 +368,7 @@ public abstract class ChangePasswordServlet extends ControlledPwmServlet
                 }
                 }
                 catch ( final Exception e )
                 catch ( final Exception e )
                 {
                 {
-                    LOGGER.error( pwmRequest, "unable to update average password sync time statistic: " + e.getMessage() );
+                    LOGGER.error( pwmRequest, () -> "unable to update average password sync time statistic: " + e.getMessage() );
                 }
                 }
             }
             }
             cpb.setChangeProgressTracker( null );
             cpb.setChangeProgressTracker( null );

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/changepw/ChangePasswordServletUtil.java

@@ -128,7 +128,7 @@ public class ChangePasswordServletUtil
             }
             }
             catch ( final ChaiOperationException e )
             catch ( final ChaiOperationException e )
             {
             {
-                LOGGER.error( pwmRequest, "error during param validation of '" + attrName + "', error: " + e.getMessage() );
+                LOGGER.error( pwmRequest, () -> "error during param validation of '" + attrName + "', error: " + e.getMessage() );
                 throw new PwmDataValidationException( new ErrorInformation(
                 throw new PwmDataValidationException( new ErrorInformation(
                         PwmError.ERROR_INCORRECT_RESPONSE,
                         PwmError.ERROR_INCORRECT_RESPONSE,
                         "ldap error testing value for '" + attrName + "'",
                         "ldap error testing value for '" + attrName + "'",

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/command/CommandServlet.java

@@ -109,7 +109,7 @@ public abstract class CommandServlet extends ControlledPwmServlet
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( "error processing csp report: " + e.getMessage() + ", body=" + body );
+            LOGGER.error( () -> "error processing csp report: " + e.getMessage() + ", body=" + body );
         }
         }
         return ProcessStatus.Halt;
         return ProcessStatus.Halt;
     }
     }

+ 5 - 5
server/src/main/java/password/pwm/http/servlet/configeditor/ConfigEditorServlet.java

@@ -294,7 +294,7 @@ public class ConfigEditorServlet extends ControlledPwmServlet
         else if ( theSetting == null )
         else if ( theSetting == null )
         {
         {
             final String errorStr = "readSettingAsString request for unknown key: " + key;
             final String errorStr = "readSettingAsString request for unknown key: " + key;
-            LOGGER.warn( errorStr );
+            LOGGER.warn( () -> errorStr );
             pwmRequest.outputJsonResult( RestResultBean.fromError( new ErrorInformation( PwmError.ERROR_INTERNAL, errorStr ) ) );
             pwmRequest.outputJsonResult( RestResultBean.fromError( new ErrorInformation( PwmError.ERROR_INTERNAL, errorStr ) ) );
             return ProcessStatus.Halt;
             return ProcessStatus.Halt;
         }
         }
@@ -406,7 +406,7 @@ public class ConfigEditorServlet extends ControlledPwmServlet
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
                 final String errorMsg = "error writing default value for setting " + setting.toString() + ", error: " + e.getMessage();
                 final String errorMsg = "error writing default value for setting " + setting.toString() + ", error: " + e.getMessage();
-                LOGGER.error( errorMsg, e );
+                LOGGER.error( () -> errorMsg, e );
                 throw new IllegalStateException( errorMsg, e );
                 throw new IllegalStateException( errorMsg, e );
             }
             }
             returnMap.put( "key", key );
             returnMap.put( "key", key );
@@ -554,7 +554,7 @@ public class ConfigEditorServlet extends ControlledPwmServlet
                 }
                 }
                 catch ( final Exception e )
                 catch ( final Exception e )
                 {
                 {
-                    LOGGER.error( "error updating notesText: " + e.getMessage() );
+                    LOGGER.error( () -> "error updating notesText: " + e.getMessage() );
                 }
                 }
             }
             }
             {
             {
@@ -570,7 +570,7 @@ public class ConfigEditorServlet extends ControlledPwmServlet
                     catch ( final IllegalArgumentException e )
                     catch ( final IllegalArgumentException e )
                     {
                     {
                         modifer.writeConfigProperty( ConfigurationProperty.LDAP_TEMPLATE, PwmSettingTemplate.DEFAULT.toString() );
                         modifer.writeConfigProperty( ConfigurationProperty.LDAP_TEMPLATE, PwmSettingTemplate.DEFAULT.toString() );
-                        LOGGER.error( "unknown template set request: " + requestedTemplate );
+                        LOGGER.error( () -> "unknown template set request: " + requestedTemplate );
                     }
                     }
                 }
                 }
             }
             }
@@ -793,7 +793,7 @@ public class ConfigEditorServlet extends ControlledPwmServlet
             }
             }
             catch ( final PwmException e )
             catch ( final PwmException e )
             {
             {
-                LOGGER.error( pwmRequest, "error during https certificate upload: " + e.getMessage() );
+                LOGGER.error( pwmRequest, () -> "error during https certificate upload: " + e.getMessage() );
                 pwmRequest.respondWithError( e.getErrorInformation(), false );
                 pwmRequest.respondWithError( e.getErrorInformation(), false );
                 return ProcessStatus.Halt;
                 return ProcessStatus.Halt;
             }
             }

+ 3 - 3
server/src/main/java/password/pwm/http/servlet/configeditor/ConfigEditorServletUtils.java

@@ -69,7 +69,7 @@ public class ConfigEditorServletUtils
         catch ( final PwmException e )
         catch ( final PwmException e )
         {
         {
             pwmRequest.outputJsonResult( RestResultBean.fromError( e.getErrorInformation(), pwmRequest ) );
             pwmRequest.outputJsonResult( RestResultBean.fromError( e.getErrorInformation(), pwmRequest ) );
-            LOGGER.error( pwmRequest, "error during file upload: " + e.getErrorInformation().toDebugStr() );
+            LOGGER.error( pwmRequest, () -> "error during file upload: " + e.getErrorInformation().toDebugStr() );
             return null;
             return null;
         }
         }
         catch ( final Throwable e )
         catch ( final Throwable e )
@@ -92,7 +92,7 @@ public class ConfigEditorServletUtils
 
 
         final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_INTERNAL, "no file found in upload" );
         final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_INTERNAL, "no file found in upload" );
         pwmRequest.outputJsonResult( RestResultBean.fromError( errorInformation, pwmRequest ) );
         pwmRequest.outputJsonResult( RestResultBean.fromError( errorInformation, pwmRequest ) );
-        LOGGER.error( pwmRequest, "error during file upload: " + errorInformation.toDebugStr() );
+        LOGGER.error( pwmRequest, () -> "error during file upload: " + errorInformation.toDebugStr() );
         return null;
         return null;
     }
     }
 
 
@@ -159,7 +159,7 @@ public class ConfigEditorServletUtils
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( pwmRequest, "error generating health records: " + e.getMessage() );
+            LOGGER.error( pwmRequest, () -> "error generating health records: " + e.getMessage() );
         }
         }
 
 
         return HealthData.builder().build();
         return HealthData.builder().build();

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/configguide/ConfigGuideForm.java

@@ -248,7 +248,7 @@ public class ConfigGuideForm
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( "error calculating ldap hostname example: " + e.getMessage() );
+            LOGGER.error( () -> "error calculating ldap hostname example: " + e.getMessage() );
         }
         }
         return "ldap.example.com";
         return "ldap.example.com";
     }
     }

+ 8 - 8
server/src/main/java/password/pwm/http/servlet/configguide/ConfigGuideServlet.java

@@ -164,7 +164,7 @@ public class ConfigGuideServlet extends ControlledPwmServlet
         if ( pwmApplication.getApplicationMode() != PwmApplicationMode.NEW )
         if ( pwmApplication.getApplicationMode() != PwmApplicationMode.NEW )
         {
         {
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_SERVICE_NOT_AVAILABLE, "ConfigGuide unavailable unless in NEW mode" );
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_SERVICE_NOT_AVAILABLE, "ConfigGuide unavailable unless in NEW mode" );
-            LOGGER.error( pwmRequest, errorInformation.toDebugStr() );
+            LOGGER.error( pwmRequest, () -> errorInformation.toDebugStr() );
             throw new PwmUnrecoverableException( errorInformation );
             throw new PwmUnrecoverableException( errorInformation );
         }
         }
 
 
@@ -196,7 +196,7 @@ public class ConfigGuideServlet extends ControlledPwmServlet
             }
             }
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
-                LOGGER.error( "error reading/testing ldap server certificates: " + e.getMessage() );
+                LOGGER.error( () -> "error reading/testing ldap server certificates: " + e.getMessage() );
             }
             }
         }
         }
 
 
@@ -456,7 +456,7 @@ public class ConfigGuideServlet extends ControlledPwmServlet
             catch ( final IllegalArgumentException e )
             catch ( final IllegalArgumentException e )
             {
             {
                 final String errorMsg = "unknown goto step request: " + requestedStep;
                 final String errorMsg = "unknown goto step request: " + requestedStep;
-                LOGGER.error( pwmRequest, errorMsg );
+                LOGGER.error( pwmRequest, () -> errorMsg );
             }
             }
         }
         }
 
 
@@ -498,7 +498,7 @@ public class ConfigGuideServlet extends ControlledPwmServlet
             }
             }
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
-                LOGGER.error( pwmRequest, "error during save: " + e.getMessage(), e );
+                LOGGER.error( pwmRequest, () -> "error during save: " + e.getMessage(), e );
                 final RestResultBean restResultBean = RestResultBean.fromError( new ErrorInformation(
                 final RestResultBean restResultBean = RestResultBean.fromError( new ErrorInformation(
                         PwmError.ERROR_INTERNAL,
                         PwmError.ERROR_INTERNAL,
                         "error during save: " + e.getMessage()
                         "error during save: " + e.getMessage()
@@ -540,7 +540,7 @@ public class ConfigGuideServlet extends ControlledPwmServlet
         {
         {
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_INTERNAL, e.getMessage() );
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_INTERNAL, e.getMessage() );
             pwmRequest.outputJsonResult( RestResultBean.fromError( errorInformation, pwmRequest ) );
             pwmRequest.outputJsonResult( RestResultBean.fromError( errorInformation, pwmRequest ) );
-            LOGGER.error( pwmRequest, e.getMessage(), e );
+            LOGGER.error( pwmRequest, () -> e.getMessage(), e );
         }
         }
 
 
         return ProcessStatus.Halt;
         return ProcessStatus.Halt;
@@ -563,7 +563,7 @@ public class ConfigGuideServlet extends ControlledPwmServlet
         {
         {
             final RestResultBean restResultBean = RestResultBean.fromError( e.getErrorInformation(), pwmRequest );
             final RestResultBean restResultBean = RestResultBean.fromError( e.getErrorInformation(), pwmRequest );
             pwmRequest.getPwmResponse().outputJsonResult( restResultBean );
             pwmRequest.getPwmResponse().outputJsonResult( restResultBean );
-            LOGGER.error( pwmRequest, e.getErrorInformation().toDebugStr() );
+            LOGGER.error( pwmRequest, () -> e.getErrorInformation().toDebugStr() );
         }
         }
 
 
         return ProcessStatus.Halt;
         return ProcessStatus.Halt;
@@ -586,7 +586,7 @@ public class ConfigGuideServlet extends ControlledPwmServlet
         }
         }
         catch ( final PwmOperationalException e )
         catch ( final PwmOperationalException e )
         {
         {
-            LOGGER.error( "error during skip config guide: " + e.getMessage(), e );
+            LOGGER.error( () -> "error during skip config guide: " + e.getMessage(), e );
         }
         }
 
 
         return ProcessStatus.Halt;
         return ProcessStatus.Halt;
@@ -647,7 +647,7 @@ public class ConfigGuideServlet extends ControlledPwmServlet
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
             final String errorMsg = "error writing default value for setting " + setting.toString() + ", error: " + e.getMessage();
             final String errorMsg = "error writing default value for setting " + setting.toString() + ", error: " + e.getMessage();
-            LOGGER.error( errorMsg, e );
+            LOGGER.error( () -> errorMsg, e );
             throw new IllegalStateException( errorMsg, e );
             throw new IllegalStateException( errorMsg, e );
         }
         }
         returnMap.put( "key", key );
         returnMap.put( "key", key );

+ 3 - 3
server/src/main/java/password/pwm/http/servlet/configguide/ConfigGuideUtils.java

@@ -156,7 +156,7 @@ public class ConfigGuideUtils
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( "unable to create schema extender object: " + e.getMessage() );
+            LOGGER.error( () -> "unable to create schema extender object: " + e.getMessage() );
             return null;
             return null;
         }
         }
     }
     }
@@ -253,7 +253,7 @@ public class ConfigGuideUtils
                 {
                 {
                     final RestResultBean restResultBean = RestResultBean.fromError( e.getErrorInformation(), pwmRequest );
                     final RestResultBean restResultBean = RestResultBean.fromError( e.getErrorInformation(), pwmRequest );
                     pwmRequest.getPwmResponse().outputJsonResult( restResultBean );
                     pwmRequest.getPwmResponse().outputJsonResult( restResultBean );
-                    LOGGER.error( pwmRequest, e.getErrorInformation().toDebugStr() );
+                    LOGGER.error( pwmRequest, () -> e.getErrorInformation().toDebugStr() );
                 }
                 }
             }
             }
             else
             else
@@ -261,7 +261,7 @@ public class ConfigGuideUtils
                 final ErrorInformation errorInformation = new ErrorInformation( PwmError.CONFIG_UPLOAD_FAILURE, "error reading config file: no file present in upload" );
                 final ErrorInformation errorInformation = new ErrorInformation( PwmError.CONFIG_UPLOAD_FAILURE, "error reading config file: no file present in upload" );
                 final RestResultBean restResultBean = RestResultBean.fromError( errorInformation, pwmRequest );
                 final RestResultBean restResultBean = RestResultBean.fromError( errorInformation, pwmRequest );
                 pwmRequest.getPwmResponse().outputJsonResult( restResultBean );
                 pwmRequest.getPwmResponse().outputJsonResult( restResultBean );
-                LOGGER.error( pwmRequest, errorInformation.toDebugStr() );
+                LOGGER.error( pwmRequest, () -> errorInformation.toDebugStr() );
             }
             }
         }
         }
     }
     }

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/configguide/GuideStep.java

@@ -109,7 +109,7 @@ public enum GuideStep
             }
             }
             catch ( final ReflectiveOperationException e )
             catch ( final ReflectiveOperationException e )
             {
             {
-                LOGGER.error( "unexpected error during step visibility check: " + e.getMessage(), e );
+                LOGGER.error( () -> "unexpected error during step visibility check: " + e.getMessage(), e );
             }
             }
         }
         }
 
 

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/configmanager/ConfigManagerCertificatesServlet.java

@@ -208,7 +208,7 @@ public class ConfigManagerCertificatesServlet extends AbstractPwmServlet
         }
         }
         catch ( final CertificateEncodingException e )
         catch ( final CertificateEncodingException e )
         {
         {
-            LOGGER.error( "unexpected error parsing certificate detail text: " + e.getMessage() );
+            LOGGER.error( () -> "unexpected error parsing certificate detail text: " + e.getMessage() );
         }
         }
         return builder.build();
         return builder.build();
     }
     }

+ 4 - 4
server/src/main/java/password/pwm/http/servlet/configmanager/ConfigManagerLocalDBServlet.java

@@ -148,7 +148,7 @@ public class ConfigManagerLocalDBServlet extends AbstractPwmServlet
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( pwmRequest, "error downloading export localdb: " + e.getMessage() );
+            LOGGER.error( pwmRequest, () -> "error downloading export localdb: " + e.getMessage() );
         }
         }
     }
     }
 
 
@@ -175,7 +175,7 @@ public class ConfigManagerLocalDBServlet extends AbstractPwmServlet
         {
         {
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_INTERNAL, "no file found in upload" );
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_INTERNAL, "no file found in upload" );
             pwmRequest.outputJsonResult( RestResultBean.fromError( errorInformation, pwmRequest ) );
             pwmRequest.outputJsonResult( RestResultBean.fromError( errorInformation, pwmRequest ) );
-            LOGGER.error( pwmRequest, "error during database import: " + errorInformation.toDebugStr() );
+            LOGGER.error( pwmRequest, () -> "error during database import: " + errorInformation.toDebugStr() );
             return;
             return;
         }
         }
 
 
@@ -202,7 +202,7 @@ public class ConfigManagerLocalDBServlet extends AbstractPwmServlet
                     ? ( ( PwmException ) e ).getErrorInformation()
                     ? ( ( PwmException ) e ).getErrorInformation()
                     : new ErrorInformation( PwmError.ERROR_INTERNAL, e.getMessage() );
                     : new ErrorInformation( PwmError.ERROR_INTERNAL, e.getMessage() );
             pwmRequest.outputJsonResult( RestResultBean.fromError( errorInformation, pwmRequest ) );
             pwmRequest.outputJsonResult( RestResultBean.fromError( errorInformation, pwmRequest ) );
-            LOGGER.error( pwmRequest, "error during LocalDB import: " + errorInformation.toDebugStr() );
+            LOGGER.error( pwmRequest, () -> "error during LocalDB import: " + errorInformation.toDebugStr() );
             return;
             return;
         }
         }
         finally
         finally
@@ -215,7 +215,7 @@ public class ConfigManagerLocalDBServlet extends AbstractPwmServlet
                 }
                 }
                 catch ( final Exception e )
                 catch ( final Exception e )
                 {
                 {
-                    LOGGER.error( pwmRequest, "error closing LocalDB after import process: " + e.getMessage() );
+                    LOGGER.error( pwmRequest, () -> "error closing LocalDB after import process: " + e.getMessage() );
                 }
                 }
             }
             }
             contextManager.initialize();
             contextManager.initialize();

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/configmanager/ConfigManagerLoginServlet.java

@@ -377,7 +377,7 @@ public class ConfigManagerLoginServlet extends AbstractPwmServlet
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( pwmRequest, "error examining persistent config login cookie: " + e.getMessage() );
+            LOGGER.error( pwmRequest, () -> "error examining persistent config login cookie: " + e.getMessage() );
         }
         }
     }
     }
 
 

+ 3 - 3
server/src/main/java/password/pwm/http/servlet/configmanager/ConfigManagerServlet.java

@@ -325,7 +325,7 @@ public class ConfigManagerServlet extends AbstractPwmServlet
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
             final String errorString = "error saving file: " + e.getMessage();
             final String errorString = "error saving file: " + e.getMessage();
-            LOGGER.error( pwmRequest, errorString, e );
+            LOGGER.error( pwmRequest, () -> errorString, e );
             throw new PwmUnrecoverableException( new ErrorInformation( PwmError.CONFIG_FORMAT_ERROR, null, new String[]
             throw new PwmUnrecoverableException( new ErrorInformation( PwmError.CONFIG_FORMAT_ERROR, null, new String[]
                     {
                     {
                             errorString,
                             errorString,
@@ -357,7 +357,7 @@ public class ConfigManagerServlet extends AbstractPwmServlet
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( pwmRequest, "unable to download configuration: " + e.getMessage() );
+            LOGGER.error( pwmRequest, () -> "unable to download configuration: " + e.getMessage() );
         }
         }
     }
     }
 
 
@@ -374,7 +374,7 @@ public class ConfigManagerServlet extends AbstractPwmServlet
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( pwmRequest, "error during zip debug building: " + e.getMessage() );
+            LOGGER.error( pwmRequest, () -> "error during zip debug building: " + e.getMessage() );
         }
         }
     }
     }
 
 

+ 4 - 4
server/src/main/java/password/pwm/http/servlet/configmanager/ConfigManagerWordlistServlet.java

@@ -144,7 +144,7 @@ public class ConfigManagerWordlistServlet extends AbstractPwmServlet
         {
         {
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_INTERNAL, "unknown wordlist type: " + wordlistTypeParam );
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_INTERNAL, "unknown wordlist type: " + wordlistTypeParam );
             pwmRequest.outputJsonResult( RestResultBean.fromError( errorInformation, pwmRequest ) );
             pwmRequest.outputJsonResult( RestResultBean.fromError( errorInformation, pwmRequest ) );
-            LOGGER.error( pwmRequest, "error during import: " + errorInformation.toDebugStr() );
+            LOGGER.error( pwmRequest, () -> "error during import: " + errorInformation.toDebugStr() );
             return;
             return;
         }
         }
 
 
@@ -152,7 +152,7 @@ public class ConfigManagerWordlistServlet extends AbstractPwmServlet
         {
         {
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_INTERNAL, "no file found in upload" );
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_INTERNAL, "no file found in upload" );
             pwmRequest.outputJsonResult( RestResultBean.fromError( errorInformation, pwmRequest ) );
             pwmRequest.outputJsonResult( RestResultBean.fromError( errorInformation, pwmRequest ) );
-            LOGGER.error( pwmRequest, "error during import: " + errorInformation.toDebugStr() );
+            LOGGER.error( pwmRequest, () -> "error during import: " + errorInformation.toDebugStr() );
             return;
             return;
         }
         }
 
 
@@ -184,7 +184,7 @@ public class ConfigManagerWordlistServlet extends AbstractPwmServlet
         {
         {
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_INTERNAL, "unknown wordlist type: " + wordlistTypeParam );
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_INTERNAL, "unknown wordlist type: " + wordlistTypeParam );
             pwmRequest.outputJsonResult( RestResultBean.fromError( errorInformation, pwmRequest ) );
             pwmRequest.outputJsonResult( RestResultBean.fromError( errorInformation, pwmRequest ) );
-            LOGGER.error( pwmRequest, "error during clear: " + errorInformation.toDebugStr() );
+            LOGGER.error( pwmRequest, () -> "error during clear: " + errorInformation.toDebugStr() );
             return;
             return;
         }
         }
 
 
@@ -194,7 +194,7 @@ public class ConfigManagerWordlistServlet extends AbstractPwmServlet
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( "error clearing wordlist " + wordlistType + ", error: " + e.getMessage() );
+            LOGGER.error( () -> "error clearing wordlist " + wordlistType + ", error: " + e.getMessage() );
         }
         }
 
 
         pwmRequest.outputJsonResult( RestResultBean.forSuccessMessage( pwmRequest, Message.Success_Unknown ) );
         pwmRequest.outputJsonResult( RestResultBean.forSuccessMessage( pwmRequest, Message.Success_Unknown ) );

+ 4 - 4
server/src/main/java/password/pwm/http/servlet/configmanager/DebugItemGenerator.java

@@ -180,7 +180,7 @@ public class DebugItemGenerator
             catch ( final Throwable e )
             catch ( final Throwable e )
             {
             {
                 final String errorMsg = "unexpected error executing debug item output class '" + serviceClass.getName() + "', error: " + e.toString();
                 final String errorMsg = "unexpected error executing debug item output class '" + serviceClass.getName() + "', error: " + e.toString();
-                LOGGER.error( sessionLabel, errorMsg, e );
+                LOGGER.error( sessionLabel, () -> errorMsg, e );
                 debugGeneratorLogFile.appendLine( errorMsg );
                 debugGeneratorLogFile.appendLine( errorMsg );
                 final Writer stackTraceOutput = new StringWriter();
                 final Writer stackTraceOutput = new StringWriter();
                 e.printStackTrace( new PrintWriter( stackTraceOutput ) );
                 e.printStackTrace( new PrintWriter( stackTraceOutput ) );
@@ -202,7 +202,7 @@ public class DebugItemGenerator
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( "error generating " + debugFileName + ": " + e.getMessage() );
+            LOGGER.error( () -> "error generating " + debugFileName + ": " + e.getMessage() );
         }
         }
 
 
         zipOutput.flush();
         zipOutput.flush();
@@ -494,7 +494,7 @@ public class DebugItemGenerator
                 }
                 }
                 catch ( final Exception e )
                 catch ( final Exception e )
                 {
                 {
-                    LOGGER.error( debugItemInput.getSessionLabel(), "unable to generate webInfPath fileMd5sums during zip debug building: " + e.getMessage() );
+                    LOGGER.error( debugItemInput.getSessionLabel(), () -> "unable to generate webInfPath fileMd5sums during zip debug building: " + e.getMessage() );
                 }
                 }
             }
             }
 
 
@@ -506,7 +506,7 @@ public class DebugItemGenerator
                 }
                 }
                 catch ( final Exception e )
                 catch ( final Exception e )
                 {
                 {
-                    LOGGER.error( debugItemInput.getSessionLabel(), "unable to generate appPath fileMd5sums during zip debug building: " + e.getMessage() );
+                    LOGGER.error( debugItemInput.getSessionLabel(), () -> "unable to generate appPath fileMd5sums during zip debug building: " + e.getMessage() );
                 }
                 }
             }
             }
 
 

+ 5 - 5
server/src/main/java/password/pwm/http/servlet/forgottenpw/ForgottenPasswordServlet.java

@@ -912,7 +912,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
                 }
                 }
                 catch ( final ChaiOperationException e )
                 catch ( final ChaiOperationException e )
                 {
                 {
-                    LOGGER.error( pwmRequest, "error during param validation of '" + attrName + "', error: " + e.getMessage() );
+                    LOGGER.error( pwmRequest, () -> "error during param validation of '" + attrName + "', error: " + e.getMessage() );
                     throw new PwmDataValidationException( new ErrorInformation( PwmError.ERROR_INCORRECT_RESPONSE, "ldap error testing value for '" + attrName + "'", new String[]
                     throw new PwmDataValidationException( new ErrorInformation( PwmError.ERROR_INCORRECT_RESPONSE, "ldap error testing value for '" + attrName + "'", new String[]
                             {
                             {
                                     formConfiguration.getLabel( pwmRequest.getLocale() ),
                                     formConfiguration.getLabel( pwmRequest.getLocale() ),
@@ -1161,7 +1161,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
         {
         {
             final String errorMsg = "unable to unlock user " + userIdentity + " error: " + e.getMessage();
             final String errorMsg = "unable to unlock user " + userIdentity + " error: " + e.getMessage();
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_UNLOCK_FAILURE, errorMsg );
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_UNLOCK_FAILURE, errorMsg );
-            LOGGER.error( pwmRequest, errorInformation.toDebugStr() );
+            LOGGER.error( pwmRequest, () -> errorInformation.toDebugStr() );
             pwmRequest.respondWithError( errorInformation, true );
             pwmRequest.respondWithError( errorInformation, true );
         }
         }
         finally
         finally
@@ -1196,7 +1196,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
         {
         {
             final String errorMsg = "unable to unlock user " + theUser.getEntryDN() + " error: " + e.getMessage();
             final String errorMsg = "unable to unlock user " + theUser.getEntryDN() + " error: " + e.getMessage();
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_UNLOCK_FAILURE, errorMsg );
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_UNLOCK_FAILURE, errorMsg );
-            LOGGER.error( pwmRequest, errorInformation.toDebugStr() );
+            LOGGER.error( pwmRequest, () -> errorInformation.toDebugStr() );
         }
         }
 
 
         try
         try
@@ -1224,7 +1224,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
             LOGGER.warn( pwmRequest,
             LOGGER.warn( pwmRequest,
-                    "unexpected error authenticating during forgotten password recovery process user: " + e.getMessage() );
+                    () -> "unexpected error authenticating during forgotten password recovery process user: " + e.getMessage() );
             pwmRequest.respondWithError( e.getErrorInformation() );
             pwmRequest.respondWithError( e.getErrorInformation() );
         }
         }
         finally
         finally
@@ -1296,7 +1296,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
                     PwmError.ERROR_INTERNAL,
                     PwmError.ERROR_INTERNAL,
                     "unexpected error while re-loading user data due to locale change: " + e.getErrorInformation().toDebugStr()
                     "unexpected error while re-loading user data due to locale change: " + e.getErrorInformation().toDebugStr()
             );
             );
-            LOGGER.error( pwmRequest, errorInformation.toDebugStr() );
+            LOGGER.error( pwmRequest, () -> errorInformation.toDebugStr() );
             setLastError( pwmRequest, errorInformation );
             setLastError( pwmRequest, errorInformation );
         }
         }
     }
     }

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/forgottenpw/ForgottenPasswordStateMachine.java

@@ -799,7 +799,7 @@ public class ForgottenPasswordStateMachine
                         }
                         }
                         catch ( final ChaiOperationException e )
                         catch ( final ChaiOperationException e )
                         {
                         {
-                            LOGGER.error( sessionLabel, "error during param validation of '" + attrName + "', error: " + e.getMessage() );
+                            LOGGER.error( sessionLabel, () -> "error during param validation of '" + attrName + "', error: " + e.getMessage() );
                             throw new PwmDataValidationException( new ErrorInformation(
                             throw new PwmDataValidationException( new ErrorInformation(
                                     PwmError.ERROR_INCORRECT_RESPONSE, "ldap error testing value for '" + attrName + "'", new String[]
                                     PwmError.ERROR_INCORRECT_RESPONSE, "ldap error testing value for '" + attrName + "'", new String[]
                                     {
                                     {

+ 4 - 4
server/src/main/java/password/pwm/http/servlet/forgottenpw/ForgottenPasswordUtil.java

@@ -245,7 +245,7 @@ public class ForgottenPasswordUtil
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( pwmRequest, "unexpected error while examining cookie auth record: " + e.getMessage() );
+            LOGGER.error( pwmRequest, () -> "unexpected error while examining cookie auth record: " + e.getMessage() );
         }
         }
         return false;
         return false;
     }
     }
@@ -444,7 +444,7 @@ public class ForgottenPasswordUtil
         {
         {
             final String errorMsg = "unable to unlock user " + theUser.getEntryDN() + " error: " + e.getMessage();
             final String errorMsg = "unable to unlock user " + theUser.getEntryDN() + " error: " + e.getMessage();
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_UNLOCK_FAILURE, errorMsg );
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_UNLOCK_FAILURE, errorMsg );
-            LOGGER.error( pwmRequest, errorInformation.toDebugStr() );
+            LOGGER.error( pwmRequest, () -> errorInformation.toDebugStr() );
             pwmRequest.respondWithError( errorInformation );
             pwmRequest.respondWithError( errorInformation );
             return;
             return;
         }
         }
@@ -514,7 +514,7 @@ public class ForgottenPasswordUtil
         }
         }
         catch ( final PwmException e )
         catch ( final PwmException e )
         {
         {
-            LOGGER.warn( pwmRequest, "unexpected error setting new password during recovery process for user: " + e.getMessage() );
+            LOGGER.warn( pwmRequest, () -> "unexpected error setting new password during recovery process for user: " + e.getMessage() );
             pwmRequest.respondWithError( e.getErrorInformation() );
             pwmRequest.respondWithError( e.getErrorInformation() );
         }
         }
         catch ( final ChaiOperationException e )
         catch ( final ChaiOperationException e )
@@ -523,7 +523,7 @@ public class ForgottenPasswordUtil
                     PwmError.ERROR_INTERNAL,
                     PwmError.ERROR_INTERNAL,
                     "unexpected ldap error while processing recovery action " + recoveryAction + ", error: " + e.getMessage()
                     "unexpected ldap error while processing recovery action " + recoveryAction + ", error: " + e.getMessage()
             );
             );
-            LOGGER.warn( pwmRequest, errorInformation.toDebugStr() );
+            LOGGER.warn( pwmRequest, () -> errorInformation.toDebugStr() );
             pwmRequest.respondWithError( errorInformation );
             pwmRequest.respondWithError( errorInformation );
         }
         }
         finally
         finally

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/helpdesk/HelpdeskDetailInfoBean.java

@@ -140,7 +140,7 @@ public class HelpdeskDetailInfoBean implements Serializable
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( pwmRequest, "unexpected error reading userHistory for user '" + userIdentity + "', " + e.getMessage() );
+            LOGGER.error( pwmRequest, () -> "unexpected error reading userHistory for user '" + userIdentity + "', " + e.getMessage() );
         }
         }
 
 
         builder.userKey( userIdentity.toObfuscatedKey( pwmRequest.getPwmApplication() ) );
         builder.userKey( userIdentity.toObfuscatedKey( pwmRequest.getPwmApplication() ) );

+ 7 - 7
server/src/main/java/password/pwm/http/servlet/helpdesk/HelpdeskServlet.java

@@ -301,7 +301,7 @@ public class HelpdeskServlet extends ControlledPwmServlet
         }
         }
         catch ( final PwmOperationalException e )
         catch ( final PwmOperationalException e )
         {
         {
-            LOGGER.error( pwmRequest, e.getErrorInformation().toDebugStr() );
+            LOGGER.error( pwmRequest, () -> e.getErrorInformation().toDebugStr() );
             final RestResultBean restResultBean = RestResultBean.fromError( e.getErrorInformation(), pwmRequest );
             final RestResultBean restResultBean = RestResultBean.fromError( e.getErrorInformation(), pwmRequest );
             pwmRequest.outputJsonResult( restResultBean );
             pwmRequest.outputJsonResult( restResultBean );
             return ProcessStatus.Halt;
             return ProcessStatus.Halt;
@@ -346,7 +346,7 @@ public class HelpdeskServlet extends ControlledPwmServlet
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.warn( pwmRequest, "unable to read username of deleted user while creating audit record" );
+            LOGGER.warn( pwmRequest, () -> "unable to read username of deleted user while creating audit record" );
         }
         }
 
 
         // execute user delete operation
         // execute user delete operation
@@ -630,7 +630,7 @@ public class HelpdeskServlet extends ControlledPwmServlet
             final PwmError returnMsg = PwmError.forChaiError( e.getErrorCode() ) == null ? PwmError.ERROR_INTERNAL : PwmError.forChaiError( e.getErrorCode() );
             final PwmError returnMsg = PwmError.forChaiError( e.getErrorCode() ) == null ? PwmError.ERROR_INTERNAL : PwmError.forChaiError( e.getErrorCode() );
             final ErrorInformation error = new ErrorInformation( returnMsg, e.getMessage() );
             final ErrorInformation error = new ErrorInformation( returnMsg, e.getMessage() );
             pwmRequest.respondWithError( error );
             pwmRequest.respondWithError( error );
-            LOGGER.warn( pwmRequest, "error resetting password for user '" + userIdentity.toDisplayString() + "'' " + error.toDebugStr() + ", " + e.getMessage() );
+            LOGGER.warn( pwmRequest, () -> "error resetting password for user '" + userIdentity.toDisplayString() + "'' " + error.toDebugStr() + ", " + e.getMessage() );
             return ProcessStatus.Halt;
             return ProcessStatus.Halt;
         }
         }
 
 
@@ -921,7 +921,7 @@ public class HelpdeskServlet extends ControlledPwmServlet
         {
         {
             final String errorMsg = "clear otp request, but helpdesk clear otp button is not enabled";
             final String errorMsg = "clear otp request, but helpdesk clear otp button is not enabled";
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_SERVICE_NOT_AVAILABLE, errorMsg );
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_SERVICE_NOT_AVAILABLE, errorMsg );
-            LOGGER.error( pwmRequest, errorMsg );
+            LOGGER.error( pwmRequest, () -> errorMsg );
             pwmRequest.respondWithError( errorInformation );
             pwmRequest.respondWithError( errorInformation );
             return ProcessStatus.Halt;
             return ProcessStatus.Halt;
         }
         }
@@ -953,7 +953,7 @@ public class HelpdeskServlet extends ControlledPwmServlet
             final PwmError returnMsg = e.getError();
             final PwmError returnMsg = e.getError();
             final ErrorInformation error = new ErrorInformation( returnMsg, e.getMessage() );
             final ErrorInformation error = new ErrorInformation( returnMsg, e.getMessage() );
             pwmRequest.respondWithError( error );
             pwmRequest.respondWithError( error );
-            LOGGER.warn( pwmRequest, "error clearing OTP secret for user '" + userIdentity + "'' " + error.toDebugStr() + ", " + e.getMessage() );
+            LOGGER.warn( pwmRequest, () -> "error clearing OTP secret for user '" + userIdentity + "'' " + error.toDebugStr() + ", " + e.getMessage() );
             return ProcessStatus.Halt;
             return ProcessStatus.Halt;
         }
         }
 
 
@@ -1064,7 +1064,7 @@ public class HelpdeskServlet extends ControlledPwmServlet
                 }
                 }
                 catch ( final ChaiException e )
                 catch ( final ChaiException e )
                 {
                 {
-                    LOGGER.error( pwmRequest, "error comparing ldap attribute during verification " + e.getMessage() );
+                    LOGGER.error( pwmRequest, () -> "error comparing ldap attribute during verification " + e.getMessage() );
                 }
                 }
             }
             }
             if ( successCount == verificationForms.size() )
             if ( successCount == verificationForms.size() )
@@ -1321,7 +1321,7 @@ public class HelpdeskServlet extends ControlledPwmServlet
         }
         }
         catch ( final PwmException e )
         catch ( final PwmException e )
         {
         {
-            LOGGER.error( "error during set password REST operation: " + e.getMessage() );
+            LOGGER.error( () -> "error during set password REST operation: " + e.getMessage() );
             pwmRequest.outputJsonResult( RestResultBean.fromError( e.getErrorInformation(), pwmRequest ) );
             pwmRequest.outputJsonResult( RestResultBean.fromError( e.getErrorInformation(), pwmRequest ) );
             return ProcessStatus.Halt;
             return ProcessStatus.Halt;
         }
         }

+ 3 - 3
server/src/main/java/password/pwm/http/servlet/newuser/NewUserServlet.java

@@ -295,12 +295,12 @@ public class NewUserServlet extends ControlledPwmServlet
         }
         }
         catch ( final PwmOperationalException e )
         catch ( final PwmOperationalException e )
         {
         {
-            LOGGER.error( pwmRequest, "error during user creation: " + e.getMessage() );
+            LOGGER.error( pwmRequest, () -> "error during user creation: " + e.getMessage() );
             if ( newUserProfile.readSettingAsBoolean( PwmSetting.NEWUSER_DELETE_ON_FAIL ) )
             if ( newUserProfile.readSettingAsBoolean( PwmSetting.NEWUSER_DELETE_ON_FAIL ) )
             {
             {
                 NewUserUtils.deleteUserAccount( newUserDN, pwmRequest );
                 NewUserUtils.deleteUserAccount( newUserDN, pwmRequest );
             }
             }
-            LOGGER.error( pwmRequest, e.getErrorInformation().toDebugStr() );
+            LOGGER.error( pwmRequest, () -> e.getErrorInformation().toDebugStr() );
             pwmRequest.respondWithError( e.getErrorInformation() );
             pwmRequest.respondWithError( e.getErrorInformation() );
         }
         }
     }
     }
@@ -504,7 +504,7 @@ public class NewUserServlet extends ControlledPwmServlet
                     }
                     }
                     catch ( final PwmUnrecoverableException | PwmOperationalException e )
                     catch ( final PwmUnrecoverableException | PwmOperationalException e )
                     {
                     {
-                        LOGGER.error( pwmRequest, "while reading stored form data in token payload, form validation error occurred: " + e.getMessage() );
+                        LOGGER.error( pwmRequest, () -> "while reading stored form data in token payload, form validation error occurred: " + e.getMessage() );
                         errorInformation = e.getErrorInformation();
                         errorInformation = e.getErrorInformation();
                     }
                     }
                 }
                 }

+ 7 - 5
server/src/main/java/password/pwm/http/servlet/newuser/NewUserUtils.java

@@ -345,13 +345,13 @@ class NewUserUtils
     {
     {
         try
         try
         {
         {
-            NewUserUtils.LOGGER.warn( pwmRequest, "deleting ldap user account " + userDN );
+            NewUserUtils.LOGGER.warn( pwmRequest, () -> "deleting ldap user account " + userDN );
             pwmRequest.getConfig().getDefaultLdapProfile().getProxyChaiProvider( pwmRequest.getPwmApplication() ).deleteEntry( userDN );
             pwmRequest.getConfig().getDefaultLdapProfile().getProxyChaiProvider( pwmRequest.getPwmApplication() ).deleteEntry( userDN );
-            NewUserUtils.LOGGER.warn( pwmRequest, "ldap user account " + userDN + " has been deleted" );
+            NewUserUtils.LOGGER.warn( pwmRequest, () -> "ldap user account " + userDN + " has been deleted" );
         }
         }
         catch ( final ChaiUnavailableException | ChaiOperationException e )
         catch ( final ChaiUnavailableException | ChaiOperationException e )
         {
         {
-            NewUserUtils.LOGGER.error( pwmRequest, "error deleting ldap user account " + userDN + ", " + e.getMessage() );
+            NewUserUtils.LOGGER.error( pwmRequest, () -> "error deleting ldap user account " + userDN + ", " + e.getMessage() );
         }
         }
 
 
         pwmRequest.getPwmSession().unauthenticateUser( pwmRequest );
         pwmRequest.getPwmSession().unauthenticateUser( pwmRequest );
@@ -423,8 +423,10 @@ class NewUserUtils
             NewUserUtils.LOGGER.debug( pwmRequest, () -> "generated entry name for new user is not unique, will try again" );
             NewUserUtils.LOGGER.debug( pwmRequest, () -> "generated entry name for new user is not unique, will try again" );
             attemptCount++;
             attemptCount++;
         }
         }
+
+        final int attemptCountFinal = attemptCount;
         NewUserUtils.LOGGER.error( pwmRequest,
         NewUserUtils.LOGGER.error( pwmRequest,
-                "failed to generate new user DN after " + attemptCount + " attempts, failed values: " + JsonUtil.serializeCollection(
+                () -> "failed to generate new user DN after " + attemptCountFinal + " attempts, failed values: " + JsonUtil.serializeCollection(
                         failedValues ) );
                         failedValues ) );
         throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_NEW_USER_FAILURE,
         throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_NEW_USER_FAILURE,
                 "unable to generate a unique DN value" ) );
                 "unable to generate a unique DN value" ) );
@@ -450,7 +452,7 @@ class NewUserUtils
         catch ( final PwmOperationalException e )
         catch ( final PwmOperationalException e )
         {
         {
             final String msg = "ldap error while searching for duplicate entry names: " + e.getMessage();
             final String msg = "ldap error while searching for duplicate entry names: " + e.getMessage();
-            NewUserUtils.LOGGER.error( pwmRequest, msg );
+            NewUserUtils.LOGGER.error( pwmRequest, () -> msg );
             throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_NEW_USER_FAILURE, msg ) );
             throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_NEW_USER_FAILURE, msg ) );
         }
         }
     }
     }

+ 10 - 10
server/src/main/java/password/pwm/http/servlet/oauth/OAuthConsumerServlet.java

@@ -107,7 +107,7 @@ public class OAuthConsumerServlet extends AbstractPwmServlet
                 final String errorMsg = "oauth consumer reached, but oauth authentication has not yet been initiated.";
                 final String errorMsg = "oauth consumer reached, but oauth authentication has not yet been initiated.";
                 final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_OAUTH_ERROR, errorMsg );
                 final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_OAUTH_ERROR, errorMsg );
                 pwmRequest.respondWithError( errorInformation );
                 pwmRequest.respondWithError( errorInformation );
-                LOGGER.error( pwmRequest, errorMsg );
+                LOGGER.error( pwmRequest, () -> errorMsg );
                 return;
                 return;
             }
             }
         }
         }
@@ -119,7 +119,7 @@ public class OAuthConsumerServlet extends AbstractPwmServlet
             {
             {
                 final String errorMsg = "incoming request from remote oauth server is indicating an error: " + oauthRequestError;
                 final String errorMsg = "incoming request from remote oauth server is indicating an error: " + oauthRequestError;
                 final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_OAUTH_ERROR, errorMsg, "Remote Error: " + oauthRequestError, null );
                 final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_OAUTH_ERROR, errorMsg, "Remote Error: " + oauthRequestError, null );
-                LOGGER.error( pwmRequest, errorMsg );
+                LOGGER.error( pwmRequest, () -> errorMsg );
                 pwmRequest.respondWithError( errorInformation );
                 pwmRequest.respondWithError( errorInformation );
                 return;
                 return;
             }
             }
@@ -138,7 +138,7 @@ public class OAuthConsumerServlet extends AbstractPwmServlet
                     final String errorMsg = "oauth consumer reached via " + OAuthUseCase.ForgottenPassword + ", but user is already authenticated";
                     final String errorMsg = "oauth consumer reached via " + OAuthUseCase.ForgottenPassword + ", but user is already authenticated";
                     final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_OAUTH_ERROR, errorMsg );
                     final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_OAUTH_ERROR, errorMsg );
                     pwmRequest.respondWithError( errorInformation );
                     pwmRequest.respondWithError( errorInformation );
-                    LOGGER.error( pwmRequest, errorMsg );
+                    LOGGER.error( pwmRequest, () -> errorMsg );
                     return;
                     return;
 
 
                 default:
                 default:
@@ -154,7 +154,7 @@ public class OAuthConsumerServlet extends AbstractPwmServlet
         {
         {
             final String errorMsg = "state parameter is missing from oauth request";
             final String errorMsg = "state parameter is missing from oauth request";
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_OAUTH_ERROR, errorMsg );
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_OAUTH_ERROR, errorMsg );
-            LOGGER.error( pwmRequest, errorMsg );
+            LOGGER.error( pwmRequest, () -> errorMsg );
             pwmRequest.respondWithError( errorInformation );
             pwmRequest.respondWithError( errorInformation );
             return;
             return;
         }
         }
@@ -192,7 +192,7 @@ public class OAuthConsumerServlet extends AbstractPwmServlet
                 final String errorMsg = "unexpected error redirecting user to oauth page: " + e.toString();
                 final String errorMsg = "unexpected error redirecting user to oauth page: " + e.toString();
                 final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_OAUTH_ERROR, errorMsg );
                 final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_OAUTH_ERROR, errorMsg );
                 setLastError( pwmRequest, errorInformation );
                 setLastError( pwmRequest, errorInformation );
-                LOGGER.error( errorInformation.toDebugStr() );
+                LOGGER.error( () -> errorInformation.toDebugStr() );
             }
             }
         }
         }
 
 
@@ -209,7 +209,7 @@ public class OAuthConsumerServlet extends AbstractPwmServlet
             final String errorMsg = "unexpected error communicating with oauth server: " + e.toString();
             final String errorMsg = "unexpected error communicating with oauth server: " + e.toString();
             final ErrorInformation errorInformation = new ErrorInformation( e.getError(), errorMsg );
             final ErrorInformation errorInformation = new ErrorInformation( e.getError(), errorMsg );
             setLastError( pwmRequest, errorInformation );
             setLastError( pwmRequest, errorInformation );
-            LOGGER.error( errorInformation.toDebugStr() );
+            LOGGER.error( () -> errorInformation.toDebugStr() );
             return;
             return;
         }
         }
 
 
@@ -263,7 +263,7 @@ public class OAuthConsumerServlet extends AbstractPwmServlet
                 {
                 {
                     final String errorMsg = "incoming oauth code for already authenticated session does not resolve to same as logged in user ";
                     final String errorMsg = "incoming oauth code for already authenticated session does not resolve to same as logged in user ";
                     final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_OAUTH_ERROR, errorMsg );
                     final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_OAUTH_ERROR, errorMsg );
-                    LOGGER.error( pwmRequest, errorMsg );
+                    LOGGER.error( pwmRequest, () -> errorMsg );
                     pwmRequest.respondWithError( errorInformation );
                     pwmRequest.respondWithError( errorInformation );
                     pwmSession.unauthenticateUser( pwmRequest );
                     pwmSession.unauthenticateUser( pwmRequest );
                     return;
                     return;
@@ -273,7 +273,7 @@ public class OAuthConsumerServlet extends AbstractPwmServlet
             {
             {
                 final String errorMsg = "error while examining incoming oauth code for already authenticated session: " + e.getMessage();
                 final String errorMsg = "error while examining incoming oauth code for already authenticated session: " + e.getMessage();
                 final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_OAUTH_ERROR, errorMsg );
                 final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_OAUTH_ERROR, errorMsg );
-                LOGGER.error( pwmRequest, errorMsg );
+                LOGGER.error( pwmRequest, () -> errorMsg );
                 pwmRequest.respondWithError( errorInformation );
                 pwmRequest.respondWithError( errorInformation );
                 return;
                 return;
             }
             }
@@ -297,7 +297,7 @@ public class OAuthConsumerServlet extends AbstractPwmServlet
         }
         }
         catch ( final PwmException e )
         catch ( final PwmException e )
         {
         {
-            LOGGER.error( pwmRequest, "error during OAuth authentication attempt: " + e.getMessage() );
+            LOGGER.error( pwmRequest, () -> "error during OAuth authentication attempt: " + e.getMessage() );
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_OAUTH_ERROR, e.getMessage() );
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_OAUTH_ERROR, e.getMessage() );
             pwmRequest.respondWithError( errorInformation );
             pwmRequest.respondWithError( errorInformation );
             return;
             return;
@@ -326,7 +326,7 @@ public class OAuthConsumerServlet extends AbstractPwmServlet
 
 
         final String errorMsg = "unable to calculate oauth settings for incoming request state";
         final String errorMsg = "unable to calculate oauth settings for incoming request state";
         final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_OAUTH_ERROR, errorMsg );
         final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_OAUTH_ERROR, errorMsg );
-        LOGGER.error( pwmRequest, errorMsg );
+        LOGGER.error( pwmRequest, () -> errorMsg );
         throw new PwmUnrecoverableException( errorInformation );
         throw new PwmUnrecoverableException( errorInformation );
     }
     }
 
 

+ 2 - 2
server/src/main/java/password/pwm/http/servlet/oauth/OAuthMachine.java

@@ -402,9 +402,9 @@ public class OAuthMachine
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.error( sessionLabel, "error while processing oauth token refresh: " + e.getMessage() );
+            LOGGER.error( sessionLabel, () -> "error while processing oauth token refresh: " + e.getMessage() );
         }
         }
-        LOGGER.error( sessionLabel, "unable to refresh oauth token for user, unauthenticated session" );
+        LOGGER.error( sessionLabel, () -> "unable to refresh oauth token for user, unauthenticated session" );
         pwmRequest.getPwmSession().unauthenticateUser( pwmRequest );
         pwmRequest.getPwmSession().unauthenticateUser( pwmRequest );
         return true;
         return true;
     }
     }

+ 5 - 5
server/src/main/java/password/pwm/http/servlet/peoplesearch/PeopleSearchDataReader.java

@@ -302,7 +302,7 @@ class PeopleSearchDataReader
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.warn( pwmRequest, "error de-serializing configured app property json for detail links: " + e.getMessage() );
+            LOGGER.warn( pwmRequest, () -> "error de-serializing configured app property json for detail links: " + e.getMessage() );
             return Collections.emptyList();
             return Collections.emptyList();
         }
         }
         final List<LinkReferenceBean> returnList = new ArrayList<>();
         final List<LinkReferenceBean> returnList = new ArrayList<>();
@@ -624,7 +624,7 @@ class PeopleSearchDataReader
             if ( !result )
             if ( !result )
             {
             {
                 final String msg = "attempt to read data of out-of-scope userDN '" + userIdentity.toDisplayString() + "' by user " + userIdentity.toDisplayString();
                 final String msg = "attempt to read data of out-of-scope userDN '" + userIdentity.toDisplayString() + "' by user " + userIdentity.toDisplayString();
-                LOGGER.warn( pwmRequest, msg );
+                LOGGER.warn( pwmRequest, () -> msg );
                 throw PwmUnrecoverableException.newException( PwmError.ERROR_SERVICE_NOT_AVAILABLE, msg );
                 throw PwmUnrecoverableException.newException( PwmError.ERROR_SERVICE_NOT_AVAILABLE, msg );
             }
             }
         }
         }
@@ -731,7 +731,7 @@ class PeopleSearchDataReader
         }
         }
         catch ( final ChaiException e )
         catch ( final ChaiException e )
         {
         {
-            LOGGER.error( "unexpected error during detail lookup of '" + userIdentity + "', error: " + e.getMessage() );
+            LOGGER.error( () -> "unexpected error during detail lookup of '" + userIdentity + "', error: " + e.getMessage() );
             throw PwmUnrecoverableException.fromChaiException( e );
             throw PwmUnrecoverableException.fromChaiException( e );
         }
         }
     }
     }
@@ -823,7 +823,7 @@ class PeopleSearchDataReader
         catch ( final PwmOperationalException e )
         catch ( final PwmOperationalException e )
         {
         {
             final ErrorInformation errorInformation = e.getErrorInformation();
             final ErrorInformation errorInformation = e.getErrorInformation();
-            LOGGER.error( pwmRequest.getLabel(), errorInformation.toDebugStr() );
+            LOGGER.error( pwmRequest.getLabel(), () -> errorInformation.toDebugStr() );
             throw new PwmUnrecoverableException( errorInformation );
             throw new PwmUnrecoverableException( errorInformation );
         }
         }
 
 
@@ -992,7 +992,7 @@ class PeopleSearchDataReader
             }
             }
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
-                LOGGER.error( pwmRequest, "error exporting csv row data: " + e.getMessage() );
+                LOGGER.error( pwmRequest, () -> "error exporting csv row data: " + e.getMessage() );
             }
             }
         }
         }
 
 

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/peoplesearch/PeopleSearchServlet.java

@@ -197,7 +197,7 @@ public abstract class PeopleSearchServlet extends ControlledPwmServlet
         }
         }
         catch ( final PwmException e )
         catch ( final PwmException e )
         {
         {
-            LOGGER.error( pwmRequest, "error generating user detail object: " + e.getMessage() );
+            LOGGER.error( pwmRequest, () -> "error generating user detail object: " + e.getMessage() );
             pwmRequest.respondWithError( e.getErrorInformation() );
             pwmRequest.respondWithError( e.getErrorInformation() );
         }
         }
 
 

+ 5 - 3
server/src/main/java/password/pwm/http/servlet/resource/ResourceFileRequest.java

@@ -190,7 +190,8 @@ class ResourceFileRequest
 
 
         if ( !filename.startsWith( ResourceFileServlet.RESOURCE_PATH ) )
         if ( !filename.startsWith( ResourceFileServlet.RESOURCE_PATH ) )
         {
         {
-            LOGGER.warn( "illegal url request to " + filename );
+            final String filenameFinal = filename;
+            LOGGER.warn( () -> "illegal url request to " + filenameFinal );
             throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_SERVICE_NOT_AVAILABLE, "illegal url request" ) );
             throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_SERVICE_NOT_AVAILABLE, "illegal url request" ) );
         }
         }
 
 
@@ -237,7 +238,8 @@ class ResourceFileRequest
                 }
                 }
                 if ( filename.startsWith( zipResources.get( path ).getName() ) )
                 if ( filename.startsWith( zipResources.get( path ).getName() ) )
                 {
                 {
-                    LOGGER.warn( "illegal url request to " + filename + " zip resource" );
+                    final String filenameFinal = filename;
+                    LOGGER.warn( () -> "illegal url request to " + filenameFinal + " zip resource" );
                     throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_SERVICE_NOT_AVAILABLE, "illegal url request" ) );
                     throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_SERVICE_NOT_AVAILABLE, "illegal url request" ) );
                 }
                 }
             }
             }
@@ -270,7 +272,7 @@ class ResourceFileRequest
 
 
         if ( fileSystemResource == null )
         if ( fileSystemResource == null )
         {
         {
-            LOGGER.warn( "attempt to access file outside of servlet path " + file.getAbsolutePath() );
+            LOGGER.warn( () -> "attempt to access file outside of servlet path " + file.getAbsolutePath() );
             throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_SERVICE_NOT_AVAILABLE, "illegal file path request" ) );
             throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_SERVICE_NOT_AVAILABLE, "illegal file path request" ) );
         }
         }
 
 

+ 4 - 4
server/src/main/java/password/pwm/http/servlet/resource/ResourceFileServlet.java

@@ -84,7 +84,7 @@ public class ResourceFileServlet extends HttpServlet implements PwmServlet
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.error( "unable to satisfy request using standard mechanism, reverting to raw resource server" );
+            LOGGER.error( () -> "unable to satisfy request using standard mechanism, reverting to raw resource server" );
         }
         }
 
 
         if ( pwmRequest != null )
         if ( pwmRequest != null )
@@ -95,7 +95,7 @@ public class ResourceFileServlet extends HttpServlet implements PwmServlet
             }
             }
             catch ( final PwmUnrecoverableException e )
             catch ( final PwmUnrecoverableException e )
             {
             {
-                LOGGER.error( pwmRequest, "error during resource servlet request processing: " + e.getMessage() );
+                LOGGER.error( pwmRequest, () -> "error during resource servlet request processing: " + e.getMessage() );
             }
             }
         }
         }
         else
         else
@@ -106,7 +106,7 @@ public class ResourceFileServlet extends HttpServlet implements PwmServlet
             }
             }
             catch ( final PwmUnrecoverableException e )
             catch ( final PwmUnrecoverableException e )
             {
             {
-                LOGGER.error( "error serving raw resource request: " + e.getMessage() );
+                LOGGER.error( () -> "error serving raw resource request: " + e.getMessage() );
             }
             }
         }
         }
     }
     }
@@ -217,7 +217,7 @@ public class ResourceFileServlet extends HttpServlet implements PwmServlet
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( pwmRequest, "error fulfilling response for url '" + requestURI + "', error: " + e.getMessage() );
+            LOGGER.error( pwmRequest, () -> "error fulfilling response for url '" + requestURI + "', error: " + e.getMessage() );
         }
         }
     }
     }
 
 

+ 3 - 3
server/src/main/java/password/pwm/http/servlet/resource/ResourceServletConfiguration.java

@@ -103,12 +103,12 @@ class ResourceServletConfiguration
                     }
                     }
                     catch ( final IOException e )
                     catch ( final IOException e )
                     {
                     {
-                        LOGGER.warn( "unable to resource-zip file " + configuredZipFileResource + ", error: " + e.getMessage() );
+                        LOGGER.warn( () -> "unable to resource-zip file " + configuredZipFileResource + ", error: " + e.getMessage() );
                     }
                     }
                 }
                 }
                 else
                 else
                 {
                 {
-                    LOGGER.error( "can't register resource-zip file " + configuredZipFileResource.getZipFile() + " because WEB-INF path is unknown" );
+                    LOGGER.error( () -> "can't register resource-zip file " + configuredZipFileResource.getZipFile() + " because WEB-INF path is unknown" );
                 }
                 }
             }
             }
         }
         }
@@ -129,7 +129,7 @@ class ResourceServletConfiguration
             }
             }
             catch ( final IOException e )
             catch ( final IOException e )
             {
             {
-                LOGGER.error( "error assembling memory file map zip bundle: " + e.getMessage() );
+                LOGGER.error( () -> "error assembling memory file map zip bundle: " + e.getMessage() );
             }
             }
         }
         }
 
 

+ 4 - 4
server/src/main/java/password/pwm/http/servlet/resource/ResourceServletService.java

@@ -132,7 +132,7 @@ public class ResourceServletService implements PwmService
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( "error during cache initialization, will remain closed; error: " + e.getMessage() );
+            LOGGER.error( () -> "error during cache initialization, will remain closed; error: " + e.getMessage() );
             status = STATUS.CLOSED;
             status = STATUS.CLOSED;
             return;
             return;
         }
         }
@@ -143,7 +143,7 @@ public class ResourceServletService implements PwmService
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( "error during nonce generation, will remain closed; error: " + e.getMessage() );
+            LOGGER.error( () -> "error during nonce generation, will remain closed; error: " + e.getMessage() );
             status = STATUS.CLOSED;
             status = STATUS.CLOSED;
         }
         }
     }
     }
@@ -203,7 +203,7 @@ public class ResourceServletService implements PwmService
 
 
         if ( !themeName.matches( pwmRequest.getConfig().readAppProperty( AppProperty.SECURITY_INPUT_THEME_MATCH_REGEX ) ) )
         if ( !themeName.matches( pwmRequest.getConfig().readAppProperty( AppProperty.SECURITY_INPUT_THEME_MATCH_REGEX ) ) )
         {
         {
-            LOGGER.warn( pwmRequest, "discarding suspicious theme name in request: " + themeName );
+            LOGGER.warn( pwmRequest, () -> "discarding suspicious theme name in request: " + themeName );
             return false;
             return false;
         }
         }
 
 
@@ -294,7 +294,7 @@ public class ResourceServletService implements PwmService
             }
             }
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
-                LOGGER.error( "unable to generate resource path nonce: " + e.getMessage() );
+                LOGGER.error( () -> "unable to generate resource path nonce: " + e.getMessage() );
             }
             }
         }
         }
     }
     }

+ 4 - 4
server/src/main/java/password/pwm/http/servlet/updateprofile/UpdateProfileServlet.java

@@ -320,7 +320,7 @@ public class UpdateProfileServlet extends ControlledPwmServlet
         }
         }
         catch ( final PwmOperationalException e )
         catch ( final PwmOperationalException e )
         {
         {
-            LOGGER.error( pwmRequest, e.getMessage() );
+            LOGGER.error( pwmRequest, () -> e.getMessage() );
             setLastError( pwmRequest, e.getErrorInformation() );
             setLastError( pwmRequest, e.getErrorInformation() );
         }
         }
 
 
@@ -383,7 +383,7 @@ public class UpdateProfileServlet extends ControlledPwmServlet
         }
         }
         catch ( final PwmException e )
         catch ( final PwmException e )
         {
         {
-            LOGGER.error( pwmRequest, e.getMessage() );
+            LOGGER.error( pwmRequest, () -> e.getMessage() );
             setLastError( pwmRequest, e.getErrorInformation() );
             setLastError( pwmRequest, e.getErrorInformation() );
             UpdateProfileUtil.forwardToForm( pwmRequest, updateProfileProfile, updateProfileBean );
             UpdateProfileUtil.forwardToForm( pwmRequest, updateProfileProfile, updateProfileBean );
             return;
             return;
@@ -432,13 +432,13 @@ public class UpdateProfileServlet extends ControlledPwmServlet
         }
         }
         catch ( final PwmException e )
         catch ( final PwmException e )
         {
         {
-            LOGGER.error( pwmRequest, e.getMessage() );
+            LOGGER.error( pwmRequest, () -> e.getMessage() );
             setLastError( pwmRequest, e.getErrorInformation() );
             setLastError( pwmRequest, e.getErrorInformation() );
         }
         }
         catch ( final ChaiException e )
         catch ( final ChaiException e )
         {
         {
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_UPDATE_ATTRS_FAILURE, e.toString() );
             final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_UPDATE_ATTRS_FAILURE, e.toString() );
-            LOGGER.error( pwmRequest, errorInformation.toDebugStr() );
+            LOGGER.error( pwmRequest, () -> errorInformation.toDebugStr() );
             setLastError( pwmRequest, errorInformation );
             setLastError( pwmRequest, errorInformation );
         }
         }
 
 

+ 1 - 1
server/src/main/java/password/pwm/http/state/CryptoCookieBeanImpl.java

@@ -156,7 +156,7 @@ class CryptoCookieBeanImpl implements SessionBeanProvider
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.error( pwmRequest, "error writing cookie bean to response: " + e.getMessage(), e );
+            LOGGER.error( pwmRequest, () -> "error writing cookie bean to response: " + e.getMessage(), e );
         }
         }
     }
     }
 
 

+ 1 - 1
server/src/main/java/password/pwm/http/state/LocalSessionBeanImpl.java

@@ -49,7 +49,7 @@ class LocalSessionBeanImpl implements SessionBeanProvider
             }
             }
             catch ( final Exception e )
             catch ( final Exception e )
             {
             {
-                LOGGER.error( "unexpected error trying to instantiate bean class " + theClass.getName() + ": " + e.getMessage(), e );
+                LOGGER.error( () -> "unexpected error trying to instantiate bean class " + theClass.getName() + ": " + e.getMessage(), e );
             }
             }
 
 
         }
         }

+ 1 - 1
server/src/main/java/password/pwm/http/state/SessionStateService.java

@@ -211,7 +211,7 @@ public class SessionStateService implements PwmService
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
             final String errorMsg = "unexpected error trying to instantiate bean class " + theClass.getName() + ": " + e.getMessage();
             final String errorMsg = "unexpected error trying to instantiate bean class " + theClass.getName() + ": " + e.getMessage();
-            LOGGER.error( errorMsg, e );
+            LOGGER.error( () -> errorMsg, e );
             throw PwmUnrecoverableException.newException( PwmError.ERROR_INTERNAL, errorMsg );
             throw PwmUnrecoverableException.newException( PwmError.ERROR_INTERNAL, errorMsg );
         }
         }
     }
     }

+ 1 - 1
server/src/main/java/password/pwm/http/tag/CurrentUrlTag.java

@@ -52,7 +52,7 @@ public class CurrentUrlTag extends TagSupport
             {
             {
                 /* ignore */
                 /* ignore */
             }
             }
-            LOGGER.error( "error during pwmFormIDTag output of pwmFormID: " + e.getMessage() );
+            LOGGER.error( () -> "error during pwmFormIDTag output of pwmFormID: " + e.getMessage() );
         }
         }
         return EVAL_PAGE;
         return EVAL_PAGE;
     }
     }

+ 1 - 1
server/src/main/java/password/pwm/http/tag/ErrorMessageTag.java

@@ -99,7 +99,7 @@ public class ErrorMessageTag extends PwmAbstractTag
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( "error executing error message tag: " + e.getMessage(), e );
+            LOGGER.error( () -> "error executing error message tag: " + e.getMessage(), e );
             throw new JspTagException( e.getMessage() );
             throw new JspTagException( e.getMessage() );
         }
         }
         return EVAL_PAGE;
         return EVAL_PAGE;

+ 3 - 3
server/src/main/java/password/pwm/http/tag/JspThrowableHandlerTag.java

@@ -56,7 +56,7 @@ public class JspThrowableHandlerTag extends TagSupport
             final String exceptionStr = JavaHelper.throwableToString( jspThrowable );
             final String exceptionStr = JavaHelper.throwableToString( jspThrowable );
             final String errorHash = SecureEngine.hash( exceptionStr, PwmHashAlgorithm.SHA1 );
             final String errorHash = SecureEngine.hash( exceptionStr, PwmHashAlgorithm.SHA1 );
 
 
-            LOGGER.error( "jsp error reference " + errorHash, jspThrowable );
+            LOGGER.error( () -> "jsp error reference " + errorHash, jspThrowable );
 
 
             final String jspOutout = jspOutput( errorHash );
             final String jspOutout = jspOutput( errorHash );
             pageContext.getOut().write( jspOutout );
             pageContext.getOut().write( jspOutout );
@@ -71,7 +71,7 @@ public class JspThrowableHandlerTag extends TagSupport
             {
             {
                 /* ignore */
                 /* ignore */
             }
             }
-            LOGGER.error( "error during pwmFormIDTag output of pwmFormID: " + e.getMessage() );
+            LOGGER.error( () -> "error during pwmFormIDTag output of pwmFormID: " + e.getMessage() );
         }
         }
         return EVAL_PAGE;
         return EVAL_PAGE;
     }
     }
@@ -88,7 +88,7 @@ public class JspThrowableHandlerTag extends TagSupport
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( "error during pwmFormIDTag output of pwmFormID: " + e.getMessage() );
+            LOGGER.error( () -> "error during pwmFormIDTag output of pwmFormID: " + e.getMessage() );
         }
         }
         final String[] strArgs = new String[]
         final String[] strArgs = new String[]
                 {
                 {

+ 3 - 3
server/src/main/java/password/pwm/http/tag/PasswordRequirementsTag.java

@@ -493,7 +493,7 @@ public class PasswordRequirementsTag extends TagSupport
         }
         }
         catch ( final MissingResourceException e )
         catch ( final MissingResourceException e )
         {
         {
-            LOGGER.error( "unable to display requirement tag for message '" + message.toString() + "': " + e.getMessage() );
+            LOGGER.error( () -> "unable to display requirement tag for message '" + message.toString() + "': " + e.getMessage() );
         }
         }
         return "UNKNOWN MESSAGE STRING";
         return "UNKNOWN MESSAGE STRING";
     }
     }
@@ -506,7 +506,7 @@ public class PasswordRequirementsTag extends TagSupport
         }
         }
         catch ( final MissingResourceException e )
         catch ( final MissingResourceException e )
         {
         {
-            LOGGER.error( "unable to display requirement tag for message '" + message.toString() + "': " + e.getMessage() );
+            LOGGER.error( () -> "unable to display requirement tag for message '" + message.toString() + "': " + e.getMessage() );
         }
         }
         return "UNKNOWN MESSAGE STRING";
         return "UNKNOWN MESSAGE STRING";
     }
     }
@@ -591,7 +591,7 @@ public class PasswordRequirementsTag extends TagSupport
         }
         }
         catch ( final IOException | PwmException e )
         catch ( final IOException | PwmException e )
         {
         {
-            LOGGER.error( "unexpected error during password requirements generation: " + e.getMessage(), e );
+            LOGGER.error( () -> "unexpected error during password requirements generation: " + e.getMessage(), e );
             throw new JspTagException( e.getMessage() );
             throw new JspTagException( e.getMessage() );
         }
         }
         return EVAL_PAGE;
         return EVAL_PAGE;

+ 1 - 1
server/src/main/java/password/pwm/http/tag/PwmFormIDTag.java

@@ -87,7 +87,7 @@ public class PwmFormIDTag extends TagSupport
             {
             {
                 /* ignore */
                 /* ignore */
             }
             }
-            LOGGER.error( "error during pwmFormIDTag output of pwmFormID: " + e.getMessage(), e );
+            LOGGER.error( () -> "error during pwmFormIDTag output of pwmFormID: " + e.getMessage(), e );
         }
         }
         return EVAL_PAGE;
         return EVAL_PAGE;
     }
     }

+ 1 - 1
server/src/main/java/password/pwm/http/tag/PwmMacroTag.java

@@ -58,7 +58,7 @@ public class PwmMacroTag extends TagSupport
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.error( "error while processing PwmMacroTag: " + e.getMessage() );
+            LOGGER.error( () -> "error while processing PwmMacroTag: " + e.getMessage() );
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {

+ 1 - 1
server/src/main/java/password/pwm/http/tag/PwmScriptRefTag.java

@@ -62,7 +62,7 @@ public class PwmScriptRefTag extends TagSupport
         }
         }
         catch ( final Exception e )
         catch ( final Exception e )
         {
         {
-            LOGGER.error( "error during scriptRef output of pwmFormID: " + e.getMessage() );
+            LOGGER.error( () -> "error during scriptRef output of pwmFormID: " + e.getMessage() );
         }
         }
         return EVAL_PAGE;
         return EVAL_PAGE;
     }
     }

+ 2 - 2
server/src/main/java/password/pwm/http/tag/PwmScriptTag.java

@@ -64,11 +64,11 @@ public class PwmScriptTag extends BodyTagSupport
         }
         }
         catch ( final IOException e )
         catch ( final IOException e )
         {
         {
-            LOGGER.error( "IO error while processing PwmScriptTag: " + e.getMessage() );
+            LOGGER.error( () -> "IO error while processing PwmScriptTag: " + e.getMessage() );
         }
         }
         catch ( final PwmUnrecoverableException e )
         catch ( final PwmUnrecoverableException e )
         {
         {
-            LOGGER.error( "error while processing PwmScriptTag: " + e.getMessage() );
+            LOGGER.error( () -> "error while processing PwmScriptTag: " + e.getMessage() );
         }
         }
         return SKIP_BODY;
         return SKIP_BODY;
     }
     }

+ 3 - 3
server/src/main/java/password/pwm/http/tag/conditional/PwmIfTag.java

@@ -95,18 +95,18 @@ public class PwmIfTag extends BodyTagSupport
                         }
                         }
                         catch ( final ChaiUnavailableException e )
                         catch ( final ChaiUnavailableException e )
                         {
                         {
-                            LOGGER.error( "error testing jsp if '" + testEnum.toString() + "', error: " + e.getMessage() );
+                            LOGGER.error( () -> "error testing jsp if '" + testEnum.toString() + "', error: " + e.getMessage() );
                         }
                         }
                     }
                     }
                     else
                     else
                     {
                     {
                         final String errorMsg = "unknown test name '" + test + "' in pwm:If jsp tag!";
                         final String errorMsg = "unknown test name '" + test + "' in pwm:If jsp tag!";
-                        LOGGER.warn( pwmRequest, errorMsg );
+                        LOGGER.warn( pwmRequest, () -> errorMsg );
                     }
                     }
                 }
                 }
                 catch ( final PwmUnrecoverableException e )
                 catch ( final PwmUnrecoverableException e )
                 {
                 {
-                    LOGGER.error( "error executing PwmIfTag for test '" + test + "', error: " + e.getMessage() );
+                    LOGGER.error( () -> "error executing PwmIfTag for test '" + test + "', error: " + e.getMessage() );
                 }
                 }
             }
             }
         }
         }

Some files were not shown because too many files changed in this diff