Переглянути джерело

logging refactoring - level info

jrivard@gmail.com 6 роки тому
батько
коміт
545dc30987
41 змінених файлів з 107 додано та 100 видалено
  1. 7 6
      server/src/main/java/password/pwm/PwmApplication.java
  2. 1 1
      server/src/main/java/password/pwm/PwmEnvironment.java
  3. 5 0
      server/src/main/java/password/pwm/config/Configuration.java
  4. 2 2
      server/src/main/java/password/pwm/config/stored/ConfigurationReader.java
  5. 6 6
      server/src/main/java/password/pwm/config/stored/StoredConfigurationImpl.java
  6. 5 5
      server/src/main/java/password/pwm/http/ContextManager.java
  7. 1 1
      server/src/main/java/password/pwm/http/servlet/GuestRegistrationServlet.java
  8. 1 1
      server/src/main/java/password/pwm/http/servlet/admin/AdminServlet.java
  9. 1 1
      server/src/main/java/password/pwm/http/servlet/command/CommandServlet.java
  10. 2 2
      server/src/main/java/password/pwm/http/servlet/configmanager/ConfigManagerLocalDBServlet.java
  11. 1 1
      server/src/main/java/password/pwm/http/servlet/configmanager/ConfigManagerServlet.java
  12. 2 2
      server/src/main/java/password/pwm/http/servlet/forgottenpw/ForgottenPasswordServlet.java
  13. 2 1
      server/src/main/java/password/pwm/http/servlet/forgottenpw/ForgottenPasswordUtil.java
  14. 2 2
      server/src/main/java/password/pwm/http/servlet/helpdesk/HelpdeskServlet.java
  15. 1 1
      server/src/main/java/password/pwm/http/servlet/newuser/NewUserUtils.java
  16. 1 1
      server/src/main/java/password/pwm/http/servlet/updateprofile/UpdateProfileUtil.java
  17. 1 1
      server/src/main/java/password/pwm/http/tag/DisplayTag.java
  18. 9 6
      server/src/main/java/password/pwm/ldap/LdapOperationsHelper.java
  19. 1 1
      server/src/main/java/password/pwm/ldap/UserInfoReader.java
  20. 1 1
      server/src/main/java/password/pwm/ldap/schema/EdirSchemaExtender.java
  21. 1 1
      server/src/main/java/password/pwm/ldap/search/UserSearchEngine.java
  22. 2 2
      server/src/main/java/password/pwm/svc/event/AuditService.java
  23. 5 5
      server/src/main/java/password/pwm/svc/intruder/IntruderManager.java
  24. 3 3
      server/src/main/java/password/pwm/svc/report/ReportService.java
  25. 6 8
      server/src/main/java/password/pwm/svc/wordlist/SharedHistoryManager.java
  26. 3 4
      server/src/main/java/password/pwm/svc/wordlist/WordlistImporter.java
  27. 1 1
      server/src/main/java/password/pwm/util/localdb/LocalDBFactory.java
  28. 2 2
      server/src/main/java/password/pwm/util/localdb/LocalDBUtility.java
  29. 2 2
      server/src/main/java/password/pwm/util/logging/LocalDBLogger.java
  30. 1 1
      server/src/main/java/password/pwm/util/logging/PwmLogManager.java
  31. 7 7
      server/src/main/java/password/pwm/util/logging/PwmLogger.java
  32. 5 5
      server/src/main/java/password/pwm/util/operations/ActionExecutor.java
  33. 1 1
      server/src/main/java/password/pwm/util/operations/PasswordUtility.java
  34. 2 2
      server/src/main/java/password/pwm/util/operations/cr/DbCrOperator.java
  35. 2 2
      server/src/main/java/password/pwm/util/operations/cr/LdapCrOperator.java
  36. 2 2
      server/src/main/java/password/pwm/util/operations/cr/LocalDbCrOperator.java
  37. 2 2
      server/src/main/java/password/pwm/util/operations/cr/NMASCrOperator.java
  38. 1 1
      server/src/main/java/password/pwm/util/operations/otp/DbOtpOperator.java
  39. 2 2
      server/src/main/java/password/pwm/util/operations/otp/LdapOtpOperator.java
  40. 2 2
      server/src/main/java/password/pwm/util/operations/otp/LocalDbOtpOperator.java
  41. 3 3
      server/src/main/java/password/pwm/util/secure/HttpsServerCertificateManager.java

+ 7 - 6
server/src/main/java/password/pwm/PwmApplication.java

@@ -251,7 +251,7 @@ public class PwmApplication
             }
             }
         }
         }
 
 
-        LOGGER.info( "initializing, application mode=" + getApplicationMode()
+        LOGGER.info( () -> "initializing, application mode=" + getApplicationMode()
                 + ", applicationPath=" + ( pwmEnvironment.getApplicationPath() == null ? "null" : pwmEnvironment.getApplicationPath().getAbsolutePath() )
                 + ", applicationPath=" + ( pwmEnvironment.getApplicationPath() == null ? "null" : pwmEnvironment.getApplicationPath().getAbsolutePath() )
                 + ", configFile=" + ( pwmEnvironment.getConfigurationFile() == null ? "null" : pwmEnvironment.getConfigurationFile().getAbsolutePath() )
                 + ", configFile=" + ( pwmEnvironment.getConfigurationFile() == null ? "null" : pwmEnvironment.getConfigurationFile().getAbsolutePath() )
         );
         );
@@ -294,7 +294,7 @@ public class PwmApplication
         if ( !skipPostInit )
         if ( !skipPostInit )
         {
         {
             final TimeDuration totalTime = TimeDuration.fromCurrent( startTime );
             final TimeDuration totalTime = TimeDuration.fromCurrent( startTime );
-            LOGGER.info( PwmConstants.PWM_APP_NAME + " " + PwmConstants.SERVLET_VERSION + " open for bidness! (" + totalTime.asCompactString() + ")" );
+            LOGGER.info( () -> PwmConstants.PWM_APP_NAME + " " + PwmConstants.SERVLET_VERSION + " open for bidness! (" + totalTime.asCompactString() + ")" );
             StatisticsManager.incrementStat( this, Statistic.PWM_STARTUPS );
             StatisticsManager.incrementStat( this, Statistic.PWM_STARTUPS );
             LOGGER.debug( () -> "buildTime=" + PwmConstants.BUILD_TIME + ", javaLocale=" + Locale.getDefault() + ", DefaultLocale=" + PwmConstants.DEFAULT_LOCALE );
             LOGGER.debug( () -> "buildTime=" + PwmConstants.BUILD_TIME + ", javaLocale=" + Locale.getDefault() + ", DefaultLocale=" + PwmConstants.DEFAULT_LOCALE );
 
 
@@ -447,7 +447,7 @@ public class PwmApplication
                 fileOutputStream.write( outputContents.toByteArray() );
                 fileOutputStream.write( outputContents.toByteArray() );
             }
             }
 
 
-            LOGGER.info( "successfully exported application https key to keystore file " + keyStoreFile.getAbsolutePath() );
+            LOGGER.info( () -> "successfully exported application https key to keystore file " + keyStoreFile.getAbsolutePath() );
         }
         }
     }
     }
 
 
@@ -499,7 +499,7 @@ public class PwmApplication
                 fileOutputStream.write( outputContents.toByteArray() );
                 fileOutputStream.write( outputContents.toByteArray() );
             }
             }
 
 
-            LOGGER.info( "successfully wrote tomcat configuration to file " + tomcatOutputFile.getAbsolutePath() );
+            LOGGER.info( () -> "successfully wrote tomcat configuration to file " + tomcatOutputFile.getAbsolutePath() );
         }
         }
     }
     }
 
 
@@ -700,7 +700,8 @@ public class PwmApplication
             final PwmRandom pwmRandom = PwmRandom.getInstance();
             final PwmRandom pwmRandom = PwmRandom.getInstance();
             newInstanceID = Long.toHexString( pwmRandom.nextLong() ).toUpperCase();
             newInstanceID = Long.toHexString( pwmRandom.nextLong() ).toUpperCase();
 
 
-            LOGGER.info( "generated new random instanceID " + newInstanceID );
+            final String finalInstanceID = newInstanceID;
+            LOGGER.info( () -> "generated new random instanceID " + finalInstanceID );
 
 
             if ( localDB != null )
             if ( localDB != null )
             {
             {
@@ -839,7 +840,7 @@ public class PwmApplication
 
 
         pwmEnvironment.releaseFileLock();
         pwmEnvironment.releaseFileLock();
 
 
-        LOGGER.info( PwmConstants.PWM_APP_NAME + " " + PwmConstants.SERVLET_VERSION + " closed for bidness, cya!" );
+        LOGGER.info( () -> PwmConstants.PWM_APP_NAME + " " + PwmConstants.SERVLET_VERSION + " closed for bidness, cya!" );
     }
     }
 
 
     public Instant getStartupTime( )
     public Instant getStartupTime( )

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

@@ -474,7 +474,7 @@ public class PwmEnvironment
         {
         {
             if ( PwmConstants.TRIAL_MODE && applicationMode == PwmApplicationMode.RUNNING )
             if ( PwmConstants.TRIAL_MODE && applicationMode == PwmApplicationMode.RUNNING )
             {
             {
-                LOGGER.info( "application is in trial mode" );
+                LOGGER.info( () -> "application is in trial mode" );
                 this.applicationMode = PwmApplicationMode.CONFIGURATION;
                 this.applicationMode = PwmApplicationMode.CONFIGURATION;
             }
             }
             else
             else

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

@@ -126,6 +126,11 @@ public class Configuration implements SettingReader
 
 
     public void outputToLog( )
     public void outputToLog( )
     {
     {
+        if ( !LOGGER.isEnabled( PwmLogLevel.TRACE ) )
+        {
+            return;
+        }
+
         final Map<String, String> debugStrings = storedConfiguration.getModifiedSettingDebugValues( PwmConstants.DEFAULT_LOCALE, true );
         final Map<String, String> debugStrings = storedConfiguration.getModifiedSettingDebugValues( PwmConstants.DEFAULT_LOCALE, true );
         final List<Supplier<CharSequence>> outputStrings = new ArrayList<>();
         final List<Supplier<CharSequence>> outputStrings = new ArrayList<>();
 
 

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

@@ -248,7 +248,7 @@ public class ConfigurationReader
         try
         try
         {
         {
             final File tempWriteFile = new File( configFile.getAbsoluteFile() + ".new" );
             final File tempWriteFile = new File( configFile.getAbsoluteFile() + ".new" );
-            LOGGER.info( sessionLabel, "beginning write to configuration file " + tempWriteFile );
+            LOGGER.info( sessionLabel, () -> "beginning write to configuration file " + tempWriteFile );
             saveInProgress = true;
             saveInProgress = true;
 
 
             try ( FileOutputStream fileOutputStream = new FileOutputStream( tempWriteFile, false ) )
             try ( FileOutputStream fileOutputStream = new FileOutputStream( tempWriteFile, false ) )
@@ -256,7 +256,7 @@ public class ConfigurationReader
                 storedConfiguration.toXml( fileOutputStream );
                 storedConfiguration.toXml( fileOutputStream );
             }
             }
 
 
-            LOGGER.info( "saved configuration " + JsonUtil.serialize( storedConfiguration.toJsonDebugObject() ) );
+            LOGGER.info( () -> "saved configuration " + JsonUtil.serialize( storedConfiguration.toJsonDebugObject() ) );
             if ( pwmApplication != null )
             if ( pwmApplication != null )
             {
             {
                 final String actualChecksum = storedConfiguration.settingChecksum();
                 final String actualChecksum = storedConfiguration.settingChecksum();

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

@@ -840,13 +840,13 @@ public class StoredConfigurationImpl implements StoredConfiguration
 
 
         if ( theBundle == null )
         if ( theBundle == null )
         {
         {
-            LOGGER.info( "ignoring unknown locale bundle for bundle=" + bundleName + ", key=" + keyName );
+            LOGGER.info( () -> "ignoring unknown locale bundle for bundle=" + bundleName + ", key=" + keyName );
             return;
             return;
         }
         }
 
 
         if ( theBundle.getString( keyName ) == null )
         if ( theBundle.getString( keyName ) == null )
         {
         {
-            LOGGER.info( "ignoring unknown key for bundle=" + bundleName + ", key=" + keyName );
+            LOGGER.info( () -> "ignoring unknown key for bundle=" + bundleName + ", key=" + keyName );
             return;
             return;
         }
         }
 
 
@@ -854,7 +854,7 @@ public class StoredConfigurationImpl implements StoredConfiguration
         resetLocaleBundleMap( bundleName, keyName );
         resetLocaleBundleMap( bundleName, keyName );
         if ( localeMap == null || localeMap.isEmpty() )
         if ( localeMap == null || localeMap.isEmpty() )
         {
         {
-            LOGGER.info( "cleared locale bundle map for bundle=" + bundleName + ", key=" + keyName );
+            LOGGER.info( () -> "cleared locale bundle map for bundle=" + bundleName + ", key=" + keyName );
             return;
             return;
         }
         }
 
 
@@ -1257,7 +1257,7 @@ public class StoredConfigurationImpl implements StoredConfiguration
 
 
                         for ( final String destProfile : profileStringDefinitions )
                         for ( final String destProfile : profileStringDefinitions )
                         {
                         {
-                            LOGGER.info( "moving setting " + setting.getKey() + " without profile attribute to profile \"" + destProfile + "\"." );
+                            LOGGER.info( () -> "moving setting " + setting.getKey() + " without profile attribute to profile \"" + destProfile + "\"." );
                             {
                             {
                                 storedConfiguration.writeSetting( profileSetting, new StringArrayValue( profileStringDefinitions ), userIdentity );
                                 storedConfiguration.writeSetting( profileSetting, new StringArrayValue( profileStringDefinitions ), userIdentity );
                             }
                             }
@@ -1327,7 +1327,7 @@ public class StoredConfigurationImpl implements StoredConfiguration
                         {
                         {
                             if ( !validProfiles.contains( profileID ) )
                             if ( !validProfiles.contains( profileID ) )
                             {
                             {
-                                LOGGER.info( "removing setting " + setting.getKey() + " with profile \"" + profileID + "\", profile is not a valid profile" );
+                                LOGGER.info( () -> "removing setting " + setting.getKey() + " with profile \"" + profileID + "\", profile is not a valid profile" );
                                 settingElement.detach();
                                 settingElement.detach();
                             }
                             }
                         }
                         }
@@ -1350,7 +1350,7 @@ public class StoredConfigurationImpl implements StoredConfiguration
                     final String value = property.getText();
                     final String value = property.getText();
                     if ( key != null && !key.isEmpty() && value != null && !value.isEmpty() )
                     if ( key != null && !key.isEmpty() && value != null && !value.isEmpty() )
                     {
                     {
-                        LOGGER.info( "migrating app-property config element '" + key + "' to setting " + PwmSetting.APP_PROPERTY_OVERRIDES.getKey() );
+                        LOGGER.info( () -> "migrating app-property config element '" + key + "' to setting " + PwmSetting.APP_PROPERTY_OVERRIDES.getKey() );
                         final String newValue = key + "=" + value;
                         final String newValue = key + "=" + value;
                         List<String> existingValues = ( List<String> ) storedConfiguration.readSetting( PwmSetting.APP_PROPERTY_OVERRIDES ).toNativeObject();
                         List<String> existingValues = ( List<String> ) storedConfiguration.readSetting( PwmSetting.APP_PROPERTY_OVERRIDES ).toNativeObject();
                         if ( existingValues == null )
                         if ( existingValues == null )

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

@@ -388,7 +388,7 @@ public class ContextManager implements Serializable
             {
             {
                 if ( configReader.modifiedSinceLoad() )
                 if ( configReader.modifiedSinceLoad() )
                 {
                 {
-                    LOGGER.info( "configuration file modification has been detected" );
+                    LOGGER.info( () -> "configuration file modification has been detected" );
                     requestPwmApplicationRestart();
                     requestPwmApplicationRestart();
                 }
                 }
             }
             }
@@ -410,7 +410,7 @@ public class ContextManager implements Serializable
             if ( configReader != null && configReader.isSaveInProgress() )
             if ( configReader != null && configReader.isSaveInProgress() )
             {
             {
                 final TimeDuration timeDuration = TimeDuration.fromCurrent( startTime );
                 final TimeDuration timeDuration = TimeDuration.fromCurrent( startTime );
-                LOGGER.info( "delaying restart request due to in progress file save (" + timeDuration.asCompactString() + ")" );
+                LOGGER.info( () -> "delaying restart request due to in progress file save (" + timeDuration.asCompactString() + ")" );
                 taskMaster.schedule( new RestartFlagWatcher(), 1, TimeUnit.SECONDS );
                 taskMaster.schedule( new RestartFlagWatcher(), 1, TimeUnit.SECONDS );
                 return;
                 return;
             }
             }
@@ -423,7 +423,7 @@ public class ContextManager implements Serializable
 
 
                 {
                 {
                     final TimeDuration timeDuration = TimeDuration.fromCurrent( startTime );
                     final TimeDuration timeDuration = TimeDuration.fromCurrent( startTime );
-                    LOGGER.info( "beginning application restart (" + timeDuration.asCompactString() + "), restart count=" + restartCount.incrementAndGet() );
+                    LOGGER.info( () -> "beginning application restart (" + timeDuration.asCompactString() + "), restart count=" + restartCount.incrementAndGet() );
                 }
                 }
 
 
                 final Instant shutdownStartTime = Instant.now();
                 final Instant shutdownStartTime = Instant.now();
@@ -439,7 +439,7 @@ public class ContextManager implements Serializable
                 {
                 {
                     final TimeDuration timeDuration = TimeDuration.fromCurrent( startTime );
                     final TimeDuration timeDuration = TimeDuration.fromCurrent( startTime );
                     final TimeDuration shutdownDuration = TimeDuration.fromCurrent( shutdownStartTime );
                     final TimeDuration shutdownDuration = TimeDuration.fromCurrent( shutdownStartTime );
-                    LOGGER.info( "application restart; shutdown completed, ("
+                    LOGGER.info( () -> "application restart; shutdown completed, ("
                             + shutdownDuration.asCompactString()
                             + shutdownDuration.asCompactString()
                             + ") now starting new application instance ("
                             + ") now starting new application instance ("
                             + timeDuration.asCompactString() + ")" );
                             + timeDuration.asCompactString() + ")" );
@@ -448,7 +448,7 @@ public class ContextManager implements Serializable
 
 
                 {
                 {
                     final TimeDuration timeDuration = TimeDuration.fromCurrent( startTime );
                     final TimeDuration timeDuration = TimeDuration.fromCurrent( startTime );
-                    LOGGER.info( "application restart completed (" + timeDuration.asCompactString() + ")" );
+                    LOGGER.info( () -> "application restart completed (" + timeDuration.asCompactString() + ")" );
                 }
                 }
             }
             }
             finally
             finally

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

@@ -462,7 +462,7 @@ public class GuestRegistrationServlet extends AbstractPwmServlet
             final Set<String> createObjectClasses = new HashSet<>( config.readSettingAsStringArray( PwmSetting.DEFAULT_OBJECT_CLASSES ) );
             final Set<String> createObjectClasses = new HashSet<>( config.readSettingAsStringArray( PwmSetting.DEFAULT_OBJECT_CLASSES ) );
 
 
             provider.createEntry( guestUserDN, createObjectClasses, createAttributes );
             provider.createEntry( guestUserDN, createObjectClasses, createAttributes );
-            LOGGER.info( pwmSession, "created user object: " + guestUserDN );
+            LOGGER.info( pwmSession, () -> "created user object: " + guestUserDN );
 
 
             final ChaiUser theUser = provider.getEntryFactory().newChaiUser( guestUserDN );
             final ChaiUser theUser = provider.getEntryFactory().newChaiUser( guestUserDN );
             final UserIdentity userIdentity = new UserIdentity( guestUserDN, pwmSession.getUserInfo().getUserIdentity().getLdapProfileID() );
             final UserIdentity userIdentity = new UserIdentity( guestUserDN, pwmSession.getUserInfo().getUserIdentity().getLdapProfileID() );

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

@@ -350,7 +350,7 @@ public class AdminServlet extends ControlledPwmServlet
     {
     {
         if ( !pwmRequest.getPwmSession().getSessionManager().checkPermission( pwmRequest.getPwmApplication(), Permission.PWMADMIN ) )
         if ( !pwmRequest.getPwmSession().getSessionManager().checkPermission( pwmRequest.getPwmApplication(), Permission.PWMADMIN ) )
         {
         {
-            LOGGER.info( pwmRequest, "unable to execute clear intruder records" );
+            LOGGER.info( pwmRequest, () -> "unable to execute clear intruder records" );
             return ProcessStatus.Halt;
             return ProcessStatus.Halt;
         }
         }
 
 

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

@@ -311,7 +311,7 @@ public abstract class CommandServlet extends ControlledPwmServlet
         if ( !pwmRequest.isAuthenticated() )
         if ( !pwmRequest.isAuthenticated() )
         {
         {
             final String action = pwmRequest.readParameterAsString( PwmConstants.PARAM_ACTION_REQUEST );
             final String action = pwmRequest.readParameterAsString( PwmConstants.PARAM_ACTION_REQUEST );
-            LOGGER.info( pwmSession, "authentication required for " + action );
+            LOGGER.info( pwmSession, () -> "authentication required for " + action );
             pwmRequest.respondWithError( PwmError.ERROR_AUTHENTICATION_REQUIRED.toInfo() );
             pwmRequest.respondWithError( PwmError.ERROR_AUTHENTICATION_REQUIRED.toInfo() );
             return false;
             return false;
         }
         }

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

@@ -193,10 +193,10 @@ public class ConfigManagerLocalDBServlet extends AbstractPwmServlet
 
 
             localDB = LocalDBFactory.getInstance( localDBLocation, false, null, configuration );
             localDB = LocalDBFactory.getInstance( localDBLocation, false, null, configuration );
             final LocalDBUtility localDBUtility = new LocalDBUtility( localDB );
             final LocalDBUtility localDBUtility = new LocalDBUtility( localDB );
-            LOGGER.info( pwmRequest, "beginning LocalDB import" );
+            LOGGER.info( pwmRequest, () -> "beginning LocalDB import" );
             localDBUtility.importLocalDB( inputStream,
             localDBUtility.importLocalDB( inputStream,
                     LOGGER.asAppendable( PwmLogLevel.DEBUG, pwmRequest.getSessionLabel() ) );
                     LOGGER.asAppendable( PwmLogLevel.DEBUG, pwmRequest.getSessionLabel() ) );
-            LOGGER.info( pwmRequest, "completed LocalDB import" );
+            LOGGER.info( pwmRequest, () -> "completed LocalDB import" );
         }
         }
         catch ( Exception e )
         catch ( Exception e )
         {
         {

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

@@ -284,7 +284,7 @@ public class ConfigManagerServlet extends AbstractPwmServlet
             return;
             return;
         }
         }
         final HashMap<String, String> resultData = new HashMap<>();
         final HashMap<String, String> resultData = new HashMap<>();
-        LOGGER.info( pwmSession, "Configuration Locked" );
+        LOGGER.info( pwmSession, () -> "Configuration Locked" );
         pwmRequest.outputJsonResult( RestResultBean.withData( resultData ) );
         pwmRequest.outputJsonResult( RestResultBean.withData( resultData ) );
     }
     }
 
 

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

@@ -627,7 +627,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
         final boolean otpPassed;
         final boolean otpPassed;
         if ( otpUserRecord != null )
         if ( otpUserRecord != null )
         {
         {
-            LOGGER.info( pwmRequest, "checking entered OTP" );
+            LOGGER.info( pwmRequest, () -> "checking entered OTP" );
             try
             try
             {
             {
                 // forces service to use proxy account to update (write) updated otp record if necessary.
                 // forces service to use proxy account to update (write) updated otp record if necessary.
@@ -1218,7 +1218,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
             sessionAuthenticator.authUserWithUnknownPassword( userIdentity, AuthenticationType.AUTH_FROM_PUBLIC_MODULE );
             sessionAuthenticator.authUserWithUnknownPassword( userIdentity, AuthenticationType.AUTH_FROM_PUBLIC_MODULE );
             pwmSession.getLoginInfoBean().getAuthFlags().add( AuthenticationType.AUTH_FROM_PUBLIC_MODULE );
             pwmSession.getLoginInfoBean().getAuthFlags().add( AuthenticationType.AUTH_FROM_PUBLIC_MODULE );
 
 
-            LOGGER.info( pwmSession, "user successfully supplied password recovery responses, forward to change password page: " + theUser.getEntryDN() );
+            LOGGER.info( pwmSession, () -> "user successfully supplied password recovery responses, forward to change password page: " + theUser.getEntryDN() );
 
 
             // mark the event log
             // mark the event log
             pwmApplication.getAuditManager().submit( AuditEvent.RECOVER_PASSWORD, pwmSession.getUserInfo(),
             pwmApplication.getAuditManager().submit( AuditEvent.RECOVER_PASSWORD, pwmSession.getUserInfo(),

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

@@ -473,7 +473,8 @@ public class ForgottenPasswordUtil
                     pwmRequest.getLocale()
                     pwmRequest.getLocale()
             );
             );
 
 
-            LOGGER.info( pwmRequest, "user successfully supplied password recovery responses, emailing new password to: " + theUser.getEntryDN() );
+            LOGGER.info( pwmRequest, () -> "user successfully supplied password recovery responses, emailing new password to: "
+                    + theUser.getEntryDN() );
 
 
             // add post change actions
             // add post change actions
             ForgottenPasswordServlet.addPostChangeAction( pwmRequest, userIdentity );
             ForgottenPasswordServlet.addPostChangeAction( pwmRequest, userIdentity );

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

@@ -330,7 +330,7 @@ public class HelpdeskServlet extends ControlledPwmServlet
         }
         }
 
 
         final UserIdentity userIdentity = UserIdentity.fromKey( userKey, pwmApplication );
         final UserIdentity userIdentity = UserIdentity.fromKey( userKey, pwmApplication );
-        LOGGER.info( pwmSession, "received deleteUser request by " + pwmSession.getUserInfo().getUserIdentity().toString() + " for user " + userIdentity.toString() );
+        LOGGER.info( pwmSession, () -> "received deleteUser request by " + pwmSession.getUserInfo().getUserIdentity().toString() + " for user " + userIdentity.toString() );
 
 
         // check if user should be seen by actor
         // check if user should be seen by actor
         HelpdeskServletUtil.checkIfUserIdentityViewable( pwmRequest, helpdeskProfile, userIdentity );
         HelpdeskServletUtil.checkIfUserIdentityViewable( pwmRequest, helpdeskProfile, userIdentity );
@@ -385,7 +385,7 @@ public class HelpdeskServlet extends ControlledPwmServlet
             pwmApplication.getAuditManager().submit( auditRecord );
             pwmApplication.getAuditManager().submit( auditRecord );
         }
         }
 
 
-        LOGGER.info( pwmSession, "user " + userIdentity + " has been deleted" );
+        LOGGER.info( pwmSession, () -> "user " + userIdentity + " has been deleted" );
 
 
         final RestResultBean restResultBean = RestResultBean.forSuccessMessage( pwmRequest, Message.Success_Unknown );
         final RestResultBean restResultBean = RestResultBean.forSuccessMessage( pwmRequest, Message.Success_Unknown );
         pwmRequest.outputJsonResult( restResultBean );
         pwmRequest.outputJsonResult( restResultBean );

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

@@ -174,7 +174,7 @@ class NewUserUtils
             // create the ldap entry
             // create the ldap entry
             chaiProvider.createEntry( newUserDN, createObjectClasses, createAttributes );
             chaiProvider.createEntry( newUserDN, createObjectClasses, createAttributes );
 
 
-            NewUserUtils.LOGGER.info( pwmSession, "created user entry: " + newUserDN );
+            NewUserUtils.LOGGER.info( pwmSession, () -> "created user entry: " + newUserDN );
         }
         }
         catch ( ChaiOperationException e )
         catch ( ChaiOperationException e )
         {
         {

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

@@ -364,7 +364,7 @@ public class UpdateProfileUtil
         verifyFormAttributes( pwmApplication, userInfo.getUserIdentity(), locale, formMap, false );
         verifyFormAttributes( pwmApplication, userInfo.getUserIdentity(), locale, formMap, false );
 
 
         // write values.
         // write values.
-        LOGGER.info( "updating profile for " + userInfo.getUserIdentity() );
+        LOGGER.info( () -> "updating profile for " + userInfo.getUserIdentity() );
 
 
         LdapOperationsHelper.writeFormValuesToLdap( theUser, formMap, macroMachine, false );
         LdapOperationsHelper.writeFormValuesToLdap( theUser, formMap, macroMachine, false );
 
 

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

@@ -198,7 +198,7 @@ public class DisplayTag extends PwmAbstractTag
         {
         {
             if ( !displayIfMissing )
             if ( !displayIfMissing )
             {
             {
-                LOGGER.info( "error while executing jsp display tag: " + e.getMessage() );
+                LOGGER.info( () -> "error while executing jsp display tag: " + e.getMessage() );
             }
             }
         }
         }
 
 

+ 9 - 6
server/src/main/java/password/pwm/ldap/LdapOperationsHelper.java

@@ -129,7 +129,8 @@ public class LdapOperationsHelper
             {
             {
                 auxClass = newObjClass;
                 auxClass = newObjClass;
                 theUser.addAttribute( ChaiConstant.ATTR_LDAP_OBJECTCLASS, auxClass );
                 theUser.addAttribute( ChaiConstant.ATTR_LDAP_OBJECTCLASS, auxClass );
-                LOGGER.info( sessionLabel, "added objectclass '" + auxClass + "' to user " + theUser.getEntryDN() );
+                final String finalAuxClass = auxClass;
+                LOGGER.info( sessionLabel, () -> "added objectclass '" + finalAuxClass + "' to user " + theUser.getEntryDN() );
             }
             }
         }
         }
         catch ( ChaiOperationException e )
         catch ( ChaiOperationException e )
@@ -345,7 +346,7 @@ public class LdapOperationsHelper
                                     final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_LDAP_DATA_ERROR, errorMsg );
                                     final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_LDAP_DATA_ERROR, errorMsg );
                                     throw new PwmUnrecoverableException( errorInformation );
                                     throw new PwmUnrecoverableException( errorInformation );
                                 }
                                 }
-                                LOGGER.info( "set attribute on user " + theUser.getEntryDN() + " (" + formItem + "=[base64]" + sValue + ")" );
+                                LOGGER.info( () -> "set attribute on user " + theUser.getEntryDN() + " (" + formItem + "=[base64]" + sValue + ")" );
                             }
                             }
                         }
                         }
                     }
                     }
@@ -354,7 +355,7 @@ public class LdapOperationsHelper
                         try
                         try
                         {
                         {
                             theUser.deleteAttribute( attrName, null );
                             theUser.deleteAttribute( attrName, null );
-                            LOGGER.info( "deleted binary attribute value on user " + theUser.getEntryDN() + " (" + attrName + ")" );
+                            LOGGER.info( () -> "deleted binary attribute value on user " + theUser.getEntryDN() + " (" + attrName + ")" );
                         }
                         }
                         catch ( ChaiOperationException e )
                         catch ( ChaiOperationException e )
                         {
                         {
@@ -395,7 +396,8 @@ public class LdapOperationsHelper
                             try
                             try
                             {
                             {
                                 theUser.writeStringAttribute( attrName, attrValue );
                                 theUser.writeStringAttribute( attrName, attrValue );
-                                LOGGER.info( "set attribute on user " + theUser.getEntryDN() + " (" + attrName + "=" + attrValue + ")" );
+                                final String finalAttrValue = attrValue;
+                                LOGGER.info( () -> "set attribute on user " + theUser.getEntryDN() + " (" + attrName + "=" + finalAttrValue + ")" );
                             }
                             }
                             catch ( ChaiOperationException e )
                             catch ( ChaiOperationException e )
                             {
                             {
@@ -411,7 +413,7 @@ public class LdapOperationsHelper
                                 try
                                 try
                                 {
                                 {
                                     theUser.deleteAttribute( attrName, null );
                                     theUser.deleteAttribute( attrName, null );
-                                    LOGGER.info( "deleted attribute value on user " + theUser.getEntryDN() + " (" + attrName + ")" );
+                                    LOGGER.info( () -> "deleted attribute value on user " + theUser.getEntryDN() + " (" + attrName + ")" );
                                 }
                                 }
                                 catch ( ChaiOperationException e )
                                 catch ( ChaiOperationException e )
                                 {
                                 {
@@ -567,7 +569,8 @@ public class LdapOperationsHelper
                 // write it to the directory
                 // write it to the directory
                 final ChaiUser chaiUser = pwmApplication.getProxiedChaiUser( userIdentity );
                 final ChaiUser chaiUser = pwmApplication.getProxiedChaiUser( userIdentity );
                 chaiUser.writeStringAttribute( guidAttributeName, newGuid );
                 chaiUser.writeStringAttribute( guidAttributeName, newGuid );
-                LOGGER.info( sessionLabel, "added GUID value '" + newGuid + "' to user " + userIdentity );
+                final String finalNewGuid = newGuid;
+                LOGGER.info( sessionLabel, () -> "added GUID value '" + finalNewGuid + "' to user " + userIdentity );
                 return newGuid;
                 return newGuid;
             }
             }
             catch ( ChaiOperationException e )
             catch ( ChaiOperationException e )

+ 1 - 1
server/src/main/java/password/pwm/ldap/UserInfoReader.java

@@ -261,7 +261,7 @@ public class UserInfoReader implements UserInfo
         }
         }
         catch ( ChaiOperationException e )
         catch ( ChaiOperationException e )
         {
         {
-            LOGGER.info( sessionLabel, "error reading LDAP attributes for " + userDN + " while reading isPasswordExpired(): " + e.getMessage() );
+            LOGGER.info( sessionLabel, () -> "error reading LDAP attributes for " + userDN + " while reading isPasswordExpired(): " + e.getMessage() );
         }
         }
         catch ( ChaiUnavailableException e )
         catch ( ChaiUnavailableException e )
         {
         {

+ 1 - 1
server/src/main/java/password/pwm/ldap/schema/EdirSchemaExtender.java

@@ -352,7 +352,7 @@ public class EdirSchemaExtender implements SchemaExtender
 
 
     private void logActivity( final CharSequence charSequence )
     private void logActivity( final CharSequence charSequence )
     {
     {
-        LOGGER.info( charSequence );
+        LOGGER.info( () -> charSequence );
         activityLog.append( charSequence ).append( "\n" );
         activityLog.append( charSequence ).append( "\n" );
     }
     }
 
 

+ 1 - 1
server/src/main/java/password/pwm/ldap/search/UserSearchEngine.java

@@ -338,7 +338,7 @@ public class UserSearchEngine implements PwmService
 
 
             if ( ldapProfiles.size() > 1 && lastLdapFailure != null && TimeDuration.fromCurrent( lastLdapFailure ).isShorterThan( profileRetryDelayMS ) )
             if ( ldapProfiles.size() > 1 && lastLdapFailure != null && TimeDuration.fromCurrent( lastLdapFailure ).isShorterThan( profileRetryDelayMS ) )
             {
             {
-                LOGGER.info( "skipping user search on ldap profile " + ldapProfile.getIdentifier() + " due to recent unreachable status ("
+                LOGGER.info( () -> "skipping user search on ldap profile " + ldapProfile.getIdentifier() + " due to recent unreachable status ("
                         + TimeDuration.fromCurrent( lastLdapFailure ).asCompactString() + ")" );
                         + TimeDuration.fromCurrent( lastLdapFailure ).asCompactString() + ")" );
                 skipProfile = true;
                 skipProfile = true;
             }
             }

+ 2 - 2
server/src/main/java/password/pwm/svc/event/AuditService.java

@@ -165,7 +165,7 @@ public class AuditService implements PwmService
                     status = STATUS.CLOSED;
                     status = STATUS.CLOSED;
                     return;
                     return;
             }
             }
-            LOGGER.info( debugMsg );
+            LOGGER.info( () -> debugMsg );
             serviceInfo = new ServiceInfoBean( Collections.singletonList( storageMethodUsed ) );
             serviceInfo = new ServiceInfoBean( Collections.singletonList( storageMethodUsed ) );
         }
         }
         {
         {
@@ -363,7 +363,7 @@ public class AuditService implements PwmService
         }
         }
 
 
         // add to debug log
         // add to debug log
-        LOGGER.info( "audit event: " + jsonRecord );
+        LOGGER.info( () -> "audit event: " + jsonRecord );
 
 
         // add to audit db
         // add to audit db
         if ( auditVault != null )
         if ( auditVault != null )

+ 5 - 5
server/src/main/java/password/pwm/svc/intruder/IntruderManager.java

@@ -165,7 +165,7 @@ public class IntruderManager implements PwmService
                     status = STATUS.CLOSED;
                     status = STATUS.CLOSED;
                     return;
                     return;
             }
             }
-            LOGGER.info( debugMsg );
+            LOGGER.info( () -> debugMsg );
             serviceInfo = new ServiceInfoBean( Collections.singletonList( storageMethodUsed ) );
             serviceInfo = new ServiceInfoBean( Collections.singletonList( storageMethodUsed ) );
         }
         }
         final RecordStore recordStore;
         final RecordStore recordStore;
@@ -201,7 +201,7 @@ public class IntruderManager implements PwmService
                 settings.setCheckDuration( TimeDuration.of( config.readSettingAsLong( PwmSetting.INTRUDER_USER_CHECK_TIME ), TimeDuration.Unit.SECONDS ) );
                 settings.setCheckDuration( TimeDuration.of( config.readSettingAsLong( PwmSetting.INTRUDER_USER_CHECK_TIME ), TimeDuration.Unit.SECONDS ) );
                 if ( settings.getCheckCount() == 0 || settings.getCheckDuration().asMillis() == 0 || settings.getResetDuration().asMillis() == 0 )
                 if ( settings.getCheckCount() == 0 || settings.getCheckDuration().asMillis() == 0 || settings.getResetDuration().asMillis() == 0 )
                 {
                 {
-                    LOGGER.info( "intruder user checking will remain disabled due to configuration settings" );
+                    LOGGER.info( () -> "intruder user checking will remain disabled due to configuration settings" );
                 }
                 }
                 else
                 else
                 {
                 {
@@ -216,7 +216,7 @@ public class IntruderManager implements PwmService
                 settings.setCheckDuration( TimeDuration.of( config.readSettingAsLong( PwmSetting.INTRUDER_ATTRIBUTE_CHECK_TIME ), TimeDuration.Unit.MILLISECONDS ) );
                 settings.setCheckDuration( TimeDuration.of( config.readSettingAsLong( PwmSetting.INTRUDER_ATTRIBUTE_CHECK_TIME ), TimeDuration.Unit.MILLISECONDS ) );
                 if ( settings.getCheckCount() == 0 || settings.getCheckDuration().asMillis() == 0 || settings.getResetDuration().asMillis() == 0 )
                 if ( settings.getCheckCount() == 0 || settings.getCheckDuration().asMillis() == 0 || settings.getResetDuration().asMillis() == 0 )
                 {
                 {
-                    LOGGER.info( "intruder user checking will remain disabled due to configuration settings" );
+                    LOGGER.info( () -> "intruder user checking will remain disabled due to configuration settings" );
                 }
                 }
                 else
                 else
                 {
                 {
@@ -230,7 +230,7 @@ public class IntruderManager implements PwmService
                 settings.setCheckDuration( TimeDuration.of( config.readSettingAsLong( PwmSetting.INTRUDER_TOKEN_DEST_CHECK_TIME ), TimeDuration.Unit.SECONDS ) );
                 settings.setCheckDuration( TimeDuration.of( config.readSettingAsLong( PwmSetting.INTRUDER_TOKEN_DEST_CHECK_TIME ), TimeDuration.Unit.SECONDS ) );
                 if ( settings.getCheckCount() == 0 || settings.getCheckDuration().asMillis() == 0 || settings.getResetDuration().asMillis() == 0 )
                 if ( settings.getCheckCount() == 0 || settings.getCheckDuration().asMillis() == 0 || settings.getResetDuration().asMillis() == 0 )
                 {
                 {
-                    LOGGER.info( "intruder user checking will remain disabled due to configuration settings" );
+                    LOGGER.info( () -> "intruder user checking will remain disabled due to configuration settings" );
                 }
                 }
                 else
                 else
                 {
                 {
@@ -244,7 +244,7 @@ public class IntruderManager implements PwmService
                 settings.setCheckDuration( TimeDuration.of( config.readSettingAsLong( PwmSetting.INTRUDER_ADDRESS_CHECK_TIME ), TimeDuration.Unit.SECONDS ) );
                 settings.setCheckDuration( TimeDuration.of( config.readSettingAsLong( PwmSetting.INTRUDER_ADDRESS_CHECK_TIME ), TimeDuration.Unit.SECONDS ) );
                 if ( settings.getCheckCount() == 0 || settings.getCheckDuration().asMillis() == 0 || settings.getResetDuration().asMillis() == 0 )
                 if ( settings.getCheckCount() == 0 || settings.getCheckDuration().asMillis() == 0 || settings.getResetDuration().asMillis() == 0 )
                 {
                 {
-                    LOGGER.info( "intruder address checking will remain disabled due to configuration settings" );
+                    LOGGER.info( () -> "intruder address checking will remain disabled due to configuration settings" );
                 }
                 }
                 else
                 else
                 {
                 {

+ 3 - 3
server/src/main/java/password/pwm/svc/report/ReportService.java

@@ -691,10 +691,10 @@ public class ReportService implements PwmService
                         lastLogOutputTime = Instant.now();
                         lastLogOutputTime = Instant.now();
                     }
                     }
                 }
                 }
-                final TimeDuration totalTime = TimeDuration.fromCurrent( startTime );
+                final int finalExamined = examinedRecords;
                 LOGGER.info( SessionLabel.REPORTING_SESSION_LABEL,
                 LOGGER.info( SessionLabel.REPORTING_SESSION_LABEL,
-                        "completed cache review process of " + examinedRecords
-                                + " cached report records in " + totalTime.asCompactString() );
+                        () -> "completed cache review process of " + finalExamined
+                                + " cached report records in " + TimeDuration.compactFromCurrent( startTime ) );
             }
             }
         }
         }
     }
     }

+ 6 - 8
server/src/main/java/password/pwm/svc/wordlist/SharedHistoryManager.java

@@ -176,7 +176,7 @@ public class SharedHistoryManager implements PwmService
 
 
         if ( !result )
         if ( !result )
         {
         {
-            LOGGER.info( "existing db version does not match current db version db=(" + versionInDB + ")  current=(" + currentVersion + "), clearing db" );
+            LOGGER.info( () -> "existing db version does not match current db version db=(" + versionInDB + ")  current=(" + currentVersion + "), clearing db" );
             localDB.truncate( WORDS_DB );
             localDB.truncate( WORDS_DB );
             localDB.put( META_DB, KEY_VERSION, currentVersion );
             localDB.put( META_DB, KEY_VERSION, currentVersion );
             localDB.remove( META_DB, KEY_OLDEST_ENTRY );
             localDB.remove( META_DB, KEY_OLDEST_ENTRY );
@@ -230,12 +230,10 @@ public class SharedHistoryManager implements PwmService
         try
         try
         {
         {
             final long size = localDB.size( WORDS_DB );
             final long size = localDB.size( WORDS_DB );
-            final StringBuilder sb = new StringBuilder();
-            sb.append( "open with " ).append( size ).append( " words (" );
-            sb.append( TimeDuration.compactFromCurrent( startTime ) ).append( ")" );
-            sb.append( ", maxAgeMs=" ).append( TimeDuration.of( maxAgeMs, TimeDuration.Unit.MILLISECONDS ).asCompactString() );
-            sb.append( ", oldestEntry=" ).append( TimeDuration.fromCurrent( oldestEntry ).asCompactString() );
-            LOGGER.info( sb.toString() );
+            LOGGER.info( () -> "open with " + size + " words ("
+                    + TimeDuration.compactFromCurrent( startTime ) + ")"
+                    + ", maxAgeMs=" + TimeDuration.of( maxAgeMs, TimeDuration.Unit.MILLISECONDS ).asCompactString()
+                    + ", oldestEntry=" + TimeDuration.fromCurrent( oldestEntry ).asCompactString() );
         }
         }
         catch ( LocalDBException e )
         catch ( LocalDBException e )
         {
         {
@@ -457,7 +455,7 @@ public class SharedHistoryManager implements PwmService
         boolean needsClearing = false;
         boolean needsClearing = false;
         if ( localDB == null )
         if ( localDB == null )
         {
         {
-            LOGGER.info( "LocalDB is not available, will remain closed" );
+            LOGGER.info( () -> "LocalDB is not available, will remain closed" );
             status = STATUS.CLOSED;
             status = STATUS.CLOSED;
             return;
             return;
         }
         }

+ 3 - 4
server/src/main/java/password/pwm/svc/wordlist/WordlistImporter.java

@@ -265,13 +265,12 @@ class WordlistImporter implements Runnable
             throws LocalDBException
             throws LocalDBException
     {
     {
         flushBuffer();
         flushBuffer();
-        getLogger().info( makeStatString() );
+        getLogger().info( () -> makeStatString() );
         getLogger().trace( () -> "beginning wordlist size query" );
         getLogger().trace( () -> "beginning wordlist size query" );
         final long wordlistSize = wordlistBucket.size();
         final long wordlistSize = wordlistBucket.size();
 
 
-        final String logMsg = "population complete, added " + wordlistSize
-                + " total words in " + TimeDuration.fromCurrent( startTime ).asCompactString();
-        getLogger().info( logMsg );
+        getLogger().info( () -> "population complete, added " + wordlistSize
+                + " total words in " + TimeDuration.compactFromCurrent( startTime ) );
 
 
         {
         {
             final WordlistStatus wordlistStatus = WordlistStatus.builder()
             final WordlistStatus wordlistStatus = WordlistStatus.builder()

+ 1 - 1
server/src/main/java/password/pwm/util/localdb/LocalDBFactory.java

@@ -111,7 +111,7 @@ public class LocalDBFactory
                 debugText.append( ", " ).append( StringUtil.formatDiskSize( freeSpace ) ).append( " free" );
                 debugText.append( ", " ).append( StringUtil.formatDiskSize( freeSpace ) ).append( " free" );
             }
             }
         }
         }
-        LOGGER.info( debugText );
+        LOGGER.info( () -> debugText );
 
 
         return localDB;
         return localDB;
     }
     }

+ 2 - 2
server/src/main/java/password/pwm/util/localdb/LocalDBUtility.java

@@ -384,7 +384,7 @@ public class LocalDBUtility
     public void prepareForImport( )
     public void prepareForImport( )
             throws LocalDBException
             throws LocalDBException
     {
     {
-        LOGGER.info( "preparing LocalDB for import procedure" );
+        LOGGER.info( () -> "preparing LocalDB for import procedure" );
         localDB.put( LocalDB.DB.PWM_META, PwmApplication.AppAttribute.LOCALDB_IMPORT_STATUS.getKey(), "inprogress" );
         localDB.put( LocalDB.DB.PWM_META, PwmApplication.AppAttribute.LOCALDB_IMPORT_STATUS.getKey(), "inprogress" );
         for ( final LocalDB.DB loopDB : LocalDB.DB.values() )
         for ( final LocalDB.DB loopDB : LocalDB.DB.values() )
         {
         {
@@ -402,7 +402,7 @@ public class LocalDBUtility
     public void markImportComplete( )
     public void markImportComplete( )
             throws LocalDBException
             throws LocalDBException
     {
     {
-        LOGGER.info( "marking LocalDB import procedure completed" );
+        LOGGER.info( () -> "marking LocalDB import procedure completed" );
         localDB.remove( LocalDB.DB.PWM_META, PwmApplication.AppAttribute.LOCALDB_IMPORT_STATUS.getKey() );
         localDB.remove( LocalDB.DB.PWM_META, PwmApplication.AppAttribute.LOCALDB_IMPORT_STATUS.getKey() );
     }
     }
 
 

+ 2 - 2
server/src/main/java/password/pwm/util/logging/LocalDBLogger.java

@@ -95,7 +95,7 @@ public class LocalDBLogger implements PwmService
 
 
         if ( settings.getMaxEvents() == 0 )
         if ( settings.getMaxEvents() == 0 )
         {
         {
-            LOGGER.info( "maxEvents set to zero, clearing LocalDBLogger history and LocalDBLogger will remain closed" );
+            LOGGER.info( () -> "maxEvents set to zero, clearing LocalDBLogger history and LocalDBLogger will remain closed" );
             localDBListQueue.clear();
             localDBListQueue.clear();
             throw new IllegalArgumentException( "maxEvents=0, will remain closed" );
             throw new IllegalArgumentException( "maxEvents=0, will remain closed" );
         }
         }
@@ -140,7 +140,7 @@ public class LocalDBLogger implements PwmService
         cleanOnWriteFlag.set( eventQueue.size() >= settings.getMaxEvents() );
         cleanOnWriteFlag.set( eventQueue.size() >= settings.getMaxEvents() );
 
 
         final TimeDuration timeDuration = TimeDuration.fromCurrent( startTime );
         final TimeDuration timeDuration = TimeDuration.fromCurrent( startTime );
-        LOGGER.info( "open in " + timeDuration.asCompactString() + ", " + debugStats() );
+        LOGGER.info( () -> "open in " + timeDuration.asCompactString() + ", " + debugStats() );
     }
     }
 
 
 
 

+ 1 - 1
server/src/main/java/password/pwm/util/logging/PwmLogManager.java

@@ -163,7 +163,7 @@ public class PwmLogManager
                 {
                 {
                     if ( logDirectory.mkdir() )
                     if ( logDirectory.mkdir() )
                     {
                     {
-                        LOGGER.info( "created directory " + logDirectory.getAbsoluteFile() );
+                        LOGGER.info( () -> "created directory " + logDirectory.getAbsoluteFile() );
                     }
                     }
                     else
                     else
                     {
                     {

+ 7 - 7
server/src/main/java/password/pwm/util/logging/PwmLogger.java

@@ -332,19 +332,19 @@ public class PwmLogger
         doPwmSessionLogEvent( PwmLogLevel.DEBUG, pwmSession, message, e );
         doPwmSessionLogEvent( PwmLogLevel.DEBUG, pwmSession, message, e );
     }
     }
 
 
-    public void info( final CharSequence message )
+    public void info( final Supplier<CharSequence> message )
     {
     {
         doLogEvent( PwmLogLevel.INFO, null, message, null );
         doLogEvent( PwmLogLevel.INFO, null, message, null );
     }
     }
 
 
-    public void info( final PwmSession pwmSession, final CharSequence message )
+    public void info( final PwmSession pwmSession, final Supplier<CharSequence> message )
     {
     {
-        doPwmSessionLogEvent( PwmLogLevel.INFO, pwmSession, () -> message, null );
+        doPwmSessionLogEvent( PwmLogLevel.INFO, pwmSession, message, null );
     }
     }
 
 
-    public void info( final PwmRequest pwmRequest, final CharSequence message )
+    public void info( final PwmRequest pwmRequest, final Supplier<CharSequence> message )
     {
     {
-        doPwmRequestLogEvent( PwmLogLevel.INFO, pwmRequest, () -> message, null );
+        doPwmRequestLogEvent( PwmLogLevel.INFO, pwmRequest, message, null );
     }
     }
 
 
     public void info( final PwmRequest pwmRequest, final ErrorInformation errorInformation )
     public void info( final PwmRequest pwmRequest, final ErrorInformation errorInformation )
@@ -352,12 +352,12 @@ public class PwmLogger
         doPwmRequestLogEvent( PwmLogLevel.INFO, pwmRequest, () -> convertErrorInformation( errorInformation ), null );
         doPwmRequestLogEvent( PwmLogLevel.INFO, pwmRequest, () -> convertErrorInformation( errorInformation ), null );
     }
     }
 
 
-    public void info( final SessionLabel sessionLabel, final CharSequence message )
+    public void info( final SessionLabel sessionLabel, final Supplier<CharSequence> message )
     {
     {
         doLogEvent( PwmLogLevel.INFO, sessionLabel, message, null );
         doLogEvent( PwmLogLevel.INFO, sessionLabel, message, null );
     }
     }
 
 
-    public void info( final CharSequence message, final Throwable exception )
+    public void info( final Supplier<CharSequence> message, final Throwable exception )
     {
     {
         doLogEvent( PwmLogLevel.INFO, null, message, exception );
         doLogEvent( PwmLogLevel.INFO, null, message, exception );
     }
     }

+ 5 - 5
server/src/main/java/password/pwm/util/operations/ActionExecutor.java

@@ -95,7 +95,7 @@ public class ActionExecutor
             executeWebserviceAction( sessionLabel, actionConfiguration, webAction );
             executeWebserviceAction( sessionLabel, actionConfiguration, webAction );
         }
         }
 
 
-        LOGGER.info( sessionLabel, "action " + actionConfiguration.getName() + " completed successfully" );
+        LOGGER.info( sessionLabel, () -> "action " + actionConfiguration.getName() + " completed successfully" );
     }
     }
 
 
     private void executeLdapAction(
     private void executeLdapAction(
@@ -270,7 +270,7 @@ public class ActionExecutor
                 try
                 try
                 {
                 {
                     theUser.writeStringAttribute( attrName, effectiveAttrValue );
                     theUser.writeStringAttribute( attrName, effectiveAttrValue );
-                    LOGGER.info( sessionLabel, "replaced attribute on user " + theUser.getEntryDN() + " (" + attrName + "=" + effectiveAttrValue + ")" );
+                    LOGGER.info( sessionLabel, () -> "replaced attribute on user " + theUser.getEntryDN() + " (" + attrName + "=" + effectiveAttrValue + ")" );
                 }
                 }
                 catch ( ChaiOperationException e )
                 catch ( ChaiOperationException e )
                 {
                 {
@@ -288,7 +288,7 @@ public class ActionExecutor
                 try
                 try
                 {
                 {
                     theUser.addAttribute( attrName, effectiveAttrValue );
                     theUser.addAttribute( attrName, effectiveAttrValue );
-                    LOGGER.info( sessionLabel, "added attribute on user " + theUser.getEntryDN() + " (" + attrName + "=" + effectiveAttrValue + ")" );
+                    LOGGER.info( sessionLabel, () -> "added attribute on user " + theUser.getEntryDN() + " (" + attrName + "=" + effectiveAttrValue + ")" );
                 }
                 }
                 catch ( ChaiOperationException e )
                 catch ( ChaiOperationException e )
                 {
                 {
@@ -307,11 +307,11 @@ public class ActionExecutor
                 try
                 try
                 {
                 {
                     theUser.deleteAttribute( attrName, effectiveAttrValue );
                     theUser.deleteAttribute( attrName, effectiveAttrValue );
-                    LOGGER.info( sessionLabel, "deleted attribute value on user " + theUser.getEntryDN() + " (" + attrName + ")" );
+                    LOGGER.info( sessionLabel, () -> "deleted attribute value on user " + theUser.getEntryDN() + " (" + attrName + ")" );
                 }
                 }
                 catch ( ChaiOperationException e )
                 catch ( ChaiOperationException e )
                 {
                 {
-                    final String errorMsg = "error deletig '" + attrName + "' attribute value on user " + theUser.getEntryDN() + ", error: " + e.getMessage();
+                    final String errorMsg = "error deleting '" + attrName + "' attribute value on user " + theUser.getEntryDN() + ", error: " + e.getMessage();
                     final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_INTERNAL, errorMsg );
                     final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_INTERNAL, errorMsg );
                     final PwmOperationalException newException = new PwmOperationalException( errorInformation );
                     final PwmOperationalException newException = new PwmOperationalException( errorInformation );
                     newException.initCause( e );
                     newException.initCause( e );

+ 1 - 1
server/src/main/java/password/pwm/util/operations/PasswordUtility.java

@@ -477,7 +477,7 @@ public class PasswordUtility
                 : "password for user '" + userIdentity.toDisplayString() + "' has been changed by " + bindDN )
                 : "password for user '" + userIdentity.toDisplayString() + "' has been changed by " + bindDN )
                 + " (" + TimeDuration.fromCurrent( startTime ).asCompactString() + ")";
                 + " (" + TimeDuration.fromCurrent( startTime ).asCompactString() + ")";
 
 
-        LOGGER.info( sessionLabel, msg );
+        LOGGER.info( sessionLabel, () -> msg );
     }
     }
 
 
     public static void helpdeskSetUserPassword(
     public static void helpdeskSetUserPassword(

+ 2 - 2
server/src/main/java/password/pwm/util/operations/cr/DbCrOperator.java

@@ -134,7 +134,7 @@ public class DbCrOperator implements CrOperator
         {
         {
             final DatabaseAccessor databaseAccessor = pwmApplication.getDatabaseService().getAccessor();
             final DatabaseAccessor databaseAccessor = pwmApplication.getDatabaseService().getAccessor();
             databaseAccessor.remove( DatabaseTable.PWM_RESPONSES, userGUID );
             databaseAccessor.remove( DatabaseTable.PWM_RESPONSES, userGUID );
-            LOGGER.info( "cleared responses for user " + theUser.getEntryDN() + " in remote database" );
+            LOGGER.info( () -> "cleared responses for user " + theUser.getEntryDN() + " in remote database" );
         }
         }
         catch ( DatabaseException e )
         catch ( DatabaseException e )
         {
         {
@@ -180,7 +180,7 @@ public class DbCrOperator implements CrOperator
 
 
             final DatabaseAccessor databaseAccessor = pwmApplication.getDatabaseService().getAccessor();
             final DatabaseAccessor databaseAccessor = pwmApplication.getDatabaseService().getAccessor();
             databaseAccessor.put( DatabaseTable.PWM_RESPONSES, userGUID, responseSet.stringValue() );
             databaseAccessor.put( DatabaseTable.PWM_RESPONSES, userGUID, responseSet.stringValue() );
-            LOGGER.info( "saved responses for " + theUser.getEntryDN() + " in remote database (key=" + userGUID + ")" );
+            LOGGER.info( () -> "saved responses for " + theUser.getEntryDN() + " in remote database (key=" + userGUID + ")" );
         }
         }
         catch ( ChaiException e )
         catch ( ChaiException e )
         {
         {

+ 2 - 2
server/src/main/java/password/pwm/util/operations/cr/LdapCrOperator.java

@@ -105,7 +105,7 @@ public class LdapCrOperator implements CrOperator
             {
             {
                 theUser.deleteAttribute( ldapStorageAttribute, null );
                 theUser.deleteAttribute( ldapStorageAttribute, null );
             }
             }
-            LOGGER.info( "cleared responses for user to chai-ldap format" );
+            LOGGER.info( () -> "cleared responses for user to chai-ldap format" );
         }
         }
         catch ( ChaiOperationException e )
         catch ( ChaiOperationException e )
         {
         {
@@ -153,7 +153,7 @@ public class LdapCrOperator implements CrOperator
                     responseInfoBean.getCsIdentifier()
                     responseInfoBean.getCsIdentifier()
             );
             );
             ChaiCrFactory.writeChaiResponseSet( responseSet, theUser );
             ChaiCrFactory.writeChaiResponseSet( responseSet, theUser );
-            LOGGER.info( "saved responses for user to chai-ldap format" );
+            LOGGER.info( () -> "saved responses for user to chai-ldap format" );
         }
         }
         catch ( ChaiException e )
         catch ( ChaiException e )
         {
         {

+ 2 - 2
server/src/main/java/password/pwm/util/operations/cr/LocalDbCrOperator.java

@@ -129,7 +129,7 @@ public class LocalDbCrOperator implements CrOperator
         try
         try
         {
         {
             localDB.remove( LocalDB.DB.RESPONSE_STORAGE, userGUID );
             localDB.remove( LocalDB.DB.RESPONSE_STORAGE, userGUID );
-            LOGGER.info( "cleared responses for user " + theUser.getEntryDN() + " in local LocalDB" );
+            LOGGER.info( () -> "cleared responses for user " + theUser.getEntryDN() + " in local LocalDB" );
         }
         }
         catch ( LocalDBException e )
         catch ( LocalDBException e )
         {
         {
@@ -167,7 +167,7 @@ public class LocalDbCrOperator implements CrOperator
             );
             );
 
 
             localDB.put( LocalDB.DB.RESPONSE_STORAGE, userGUID, responseSet.stringValue() );
             localDB.put( LocalDB.DB.RESPONSE_STORAGE, userGUID, responseSet.stringValue() );
-            LOGGER.info( "saved responses for user in LocalDB" );
+            LOGGER.info( () -> "saved responses for user in LocalDB" );
         }
         }
         catch ( LocalDBException e )
         catch ( LocalDBException e )
         {
         {

+ 2 - 2
server/src/main/java/password/pwm/util/operations/cr/NMASCrOperator.java

@@ -344,7 +344,7 @@ public class NMASCrOperator implements CrOperator
             if ( theUser.getChaiProvider().getDirectoryVendor() == DirectoryVendor.EDIRECTORY )
             if ( theUser.getChaiProvider().getDirectoryVendor() == DirectoryVendor.EDIRECTORY )
             {
             {
                 NmasCrFactory.clearResponseSet( theUser );
                 NmasCrFactory.clearResponseSet( theUser );
-                LOGGER.info( "cleared responses for user " + theUser.getEntryDN() + " using NMAS method " );
+                LOGGER.info( () -> "cleared responses for user " + theUser.getEntryDN() + " using NMAS method " );
             }
             }
         }
         }
         catch ( ChaiException e )
         catch ( ChaiException e )
@@ -377,7 +377,7 @@ public class NMASCrOperator implements CrOperator
                         responseInfoBean.getCsIdentifier()
                         responseInfoBean.getCsIdentifier()
                 );
                 );
                 NmasCrFactory.writeResponseSet( nmasResponseSet );
                 NmasCrFactory.writeResponseSet( nmasResponseSet );
-                LOGGER.info( "saved responses for user using NMAS method " );
+                LOGGER.info( () -> "saved responses for user using NMAS method " );
             }
             }
         }
         }
         catch ( ChaiException e )
         catch ( ChaiException e )

+ 1 - 1
server/src/main/java/password/pwm/util/operations/otp/DbOtpOperator.java

@@ -158,7 +158,7 @@ public class DbOtpOperator extends AbstractOtpOperator
         {
         {
             final DatabaseAccessor databaseAccessor = pwmApplication.getDatabaseAccessor();
             final DatabaseAccessor databaseAccessor = pwmApplication.getDatabaseAccessor();
             databaseAccessor.remove( DatabaseTable.OTP, userGUID );
             databaseAccessor.remove( DatabaseTable.OTP, userGUID );
-            LOGGER.info( "cleared OTP secret for " + theUser + " in remote database (key=" + userGUID + ")" );
+            LOGGER.info( () -> "cleared OTP secret for " + theUser + " in remote database (key=" + userGUID + ")" );
         }
         }
         catch ( DatabaseException ex )
         catch ( DatabaseException ex )
         {
         {

+ 2 - 2
server/src/main/java/password/pwm/util/operations/otp/LdapOtpOperator.java

@@ -133,7 +133,7 @@ public class LdapOtpOperator extends AbstractOtpOperator
                     ? pwmApplication.getProxiedChaiUser( userIdentity )
                     ? pwmApplication.getProxiedChaiUser( userIdentity )
                     : pwmSession.getSessionManager().getActor( pwmApplication, userIdentity );
                     : pwmSession.getSessionManager().getActor( pwmApplication, userIdentity );
             theUser.writeStringAttribute( ldapStorageAttribute, value );
             theUser.writeStringAttribute( ldapStorageAttribute, value );
-            LOGGER.info( "saved OTP secret for user to chai-ldap format" );
+            LOGGER.info( () -> "saved OTP secret for user to chai-ldap format" );
         }
         }
         catch ( ChaiException ex )
         catch ( ChaiException ex )
         {
         {
@@ -177,7 +177,7 @@ public class LdapOtpOperator extends AbstractOtpOperator
         try
         try
         {
         {
             chaiUser.deleteAttribute( ldapStorageAttribute, null );
             chaiUser.deleteAttribute( ldapStorageAttribute, null );
-            LOGGER.info( "cleared OTP secret for user to chai-ldap format" );
+            LOGGER.info( () -> "cleared OTP secret for user to chai-ldap format" );
         }
         }
         catch ( ChaiOperationException e )
         catch ( ChaiOperationException e )
         {
         {

+ 2 - 2
server/src/main/java/password/pwm/util/operations/otp/LocalDbOtpOperator.java

@@ -143,7 +143,7 @@ public class LocalDbOtpOperator extends AbstractOtpOperator
             }
             }
 
 
             localDB.put( LocalDB.DB.OTP_SECRET, userGUID, value );
             localDB.put( LocalDB.DB.OTP_SECRET, userGUID, value );
-            LOGGER.info( pwmSession, "saved OTP secret for user in LocalDB" );
+            LOGGER.info( pwmSession, () -> "saved OTP secret for user in LocalDB" );
         }
         }
         catch ( LocalDBException ex )
         catch ( LocalDBException ex )
         {
         {
@@ -186,7 +186,7 @@ public class LocalDbOtpOperator extends AbstractOtpOperator
         try
         try
         {
         {
             localDB.remove( LocalDB.DB.OTP_SECRET, userGUID );
             localDB.remove( LocalDB.DB.OTP_SECRET, userGUID );
-            LOGGER.info( pwmSession, "cleared OTP secret for user in LocalDB" );
+            LOGGER.info( pwmSession, () -> "cleared OTP secret for user in LocalDB" );
         }
         }
         catch ( LocalDBException ex )
         catch ( LocalDBException ex )
         {
         {

+ 3 - 3
server/src/main/java/password/pwm/util/secure/HttpsServerCertificateManager.java

@@ -217,17 +217,17 @@ public class HttpsServerCertificateManager
             {
             {
                 if ( !cnName.equals( storedCertData.getX509Certificate().getSubjectDN().getName() ) )
                 if ( !cnName.equals( storedCertData.getX509Certificate().getSubjectDN().getName() ) )
                 {
                 {
-                    LOGGER.info( "replacing stored self cert, subject name does not match configured site url" );
+                    LOGGER.info( () -> "replacing stored self cert, subject name does not match configured site url" );
                     storedCertData = null;
                     storedCertData = null;
                 }
                 }
                 else if ( storedCertData.getX509Certificate().getNotBefore().after( new Date() ) )
                 else if ( storedCertData.getX509Certificate().getNotBefore().after( new Date() ) )
                 {
                 {
-                    LOGGER.info( "replacing stored self cert, not-before date is in the future" );
+                    LOGGER.info( () -> "replacing stored self cert, not-before date is in the future" );
                     storedCertData = null;
                     storedCertData = null;
                 }
                 }
                 else if ( storedCertData.getX509Certificate().getNotAfter().before( new Date() ) )
                 else if ( storedCertData.getX509Certificate().getNotAfter().before( new Date() ) )
                 {
                 {
-                    LOGGER.info( "replacing stored self cert, not-after date is in the past" );
+                    LOGGER.info( () -> "replacing stored self cert, not-after date is in the past" );
                     storedCertData = null;
                     storedCertData = null;
                 }
                 }
             }
             }