Browse Source

refactor logging methods to replace supplied timeduration with timeduration

Jason Rivard 3 years ago
parent
commit
691f1ad1ff
52 changed files with 117 additions and 107 deletions
  1. 14 11
      server/src/main/java/password/pwm/PwmApplication.java
  2. 3 3
      server/src/main/java/password/pwm/PwmApplicationUtil.java
  3. 2 2
      server/src/main/java/password/pwm/PwmDomain.java
  4. 14 4
      server/src/main/java/password/pwm/PwmDomainUtil.java
  5. 1 1
      server/src/main/java/password/pwm/config/PwmSettingMetaDataReader.java
  6. 1 1
      server/src/main/java/password/pwm/config/profile/LdapProfile.java
  7. 3 3
      server/src/main/java/password/pwm/config/stored/ConfigurationFileManager.java
  8. 4 4
      server/src/main/java/password/pwm/config/stored/StoredConfigurationUtil.java
  9. 3 3
      server/src/main/java/password/pwm/health/HealthService.java
  10. 1 5
      server/src/main/java/password/pwm/http/ContextManager.java
  11. 1 1
      server/src/main/java/password/pwm/http/PwmRequest.java
  12. 1 1
      server/src/main/java/password/pwm/http/filter/SessionFilter.java
  13. 1 1
      server/src/main/java/password/pwm/http/servlet/accountinfo/AccountInformationBean.java
  14. 1 1
      server/src/main/java/password/pwm/http/servlet/admin/AppDashboardData.java
  15. 1 1
      server/src/main/java/password/pwm/http/servlet/configeditor/ConfigEditorServletUtils.java
  16. 1 1
      server/src/main/java/password/pwm/http/servlet/configeditor/data/NavTreeDataMaker.java
  17. 1 1
      server/src/main/java/password/pwm/http/servlet/configeditor/data/SettingDataMaker.java
  18. 2 2
      server/src/main/java/password/pwm/http/servlet/newuser/NewUserServlet.java
  19. 1 1
      server/src/main/java/password/pwm/http/servlet/peoplesearch/PeopleSearchDataReader.java
  20. 1 1
      server/src/main/java/password/pwm/http/servlet/resource/ResourceFileServlet.java
  21. 2 2
      server/src/main/java/password/pwm/http/servlet/resource/ResourceServletService.java
  22. 2 2
      server/src/main/java/password/pwm/ldap/permission/UserPermissionUtility.java
  23. 2 2
      server/src/main/java/password/pwm/svc/PwmServiceManager.java
  24. 1 1
      server/src/main/java/password/pwm/svc/cr/CrService.java
  25. 1 1
      server/src/main/java/password/pwm/svc/cr/LdapCrOperator.java
  26. 1 1
      server/src/main/java/password/pwm/svc/email/EmailConnectionPool.java
  27. 1 1
      server/src/main/java/password/pwm/svc/email/EmailServerUtil.java
  28. 1 1
      server/src/main/java/password/pwm/svc/email/EmailService.java
  29. 1 1
      server/src/main/java/password/pwm/svc/httpclient/JavaPwmHttpClient.java
  30. 1 1
      server/src/main/java/password/pwm/svc/otp/OtpService.java
  31. 4 4
      server/src/main/java/password/pwm/svc/report/ReportService.java
  32. 1 1
      server/src/main/java/password/pwm/svc/sessiontrack/UserAgentUtils.java
  33. 1 1
      server/src/main/java/password/pwm/svc/telemetry/FtpTelemetrySender.java
  34. 1 1
      server/src/main/java/password/pwm/svc/token/DataStoreTokenMachine.java
  35. 1 1
      server/src/main/java/password/pwm/svc/userhistory/UserHistoryService.java
  36. 1 1
      server/src/main/java/password/pwm/svc/wordlist/AbstractWordlist.java
  37. 2 2
      server/src/main/java/password/pwm/svc/wordlist/SharedHistoryService.java
  38. 1 1
      server/src/main/java/password/pwm/svc/wordlist/WordlistImporter.java
  39. 3 3
      server/src/main/java/password/pwm/svc/wordlist/WordlistSource.java
  40. 2 1
      server/src/main/java/password/pwm/util/MBeanUtility.java
  41. 1 1
      server/src/main/java/password/pwm/util/debug/DebugItemGenerator.java
  42. 1 1
      server/src/main/java/password/pwm/util/debug/LogDebugItemGenerator.java
  43. 1 1
      server/src/main/java/password/pwm/util/debug/LogJsonItemGenerator.java
  44. 1 1
      server/src/main/java/password/pwm/util/localdb/LocalDBFactory.java
  45. 6 7
      server/src/main/java/password/pwm/util/localdb/WorkQueueProcessor.java
  46. 1 1
      server/src/main/java/password/pwm/util/logging/LocalDBLogger.java
  47. 13 12
      server/src/main/java/password/pwm/util/logging/PwmLogger.java
  48. 1 1
      server/src/main/java/password/pwm/util/macro/MacroMachine.java
  49. 1 1
      server/src/main/java/password/pwm/util/password/PasswordUtility.java
  50. 2 2
      server/src/main/java/password/pwm/util/password/RandomPasswordGenerator.java
  51. 1 1
      server/src/main/java/password/pwm/ws/server/RestServlet.java
  52. 1 1
      server/src/main/java/password/pwm/ws/server/rest/RestStatusServer.java

+ 14 - 11
server/src/main/java/password/pwm/PwmApplication.java

@@ -219,10 +219,6 @@ public class PwmApplication
         installTime = fetchInstallDate( startupTime );
         LOGGER.debug( sessionLabel, () -> "this application instance first installed on " + StringUtil.toIsoDate( installTime ) );
 
-        LOGGER.debug( sessionLabel, () -> "application environment flags: " + JsonFactory.get().serializeCollection( pwmEnvironment.getFlags() ) );
-        LOGGER.debug( sessionLabel, () -> "application environment parameters: "
-                + JsonFactory.get().serializeMap( pwmEnvironment.getParameters(), PwmEnvironment.ApplicationParameter.class, String.class ) );
-
         pwmScheduler = new PwmScheduler( this );
 
         domains = PwmDomainUtil.createDomainInstances( this );
@@ -243,14 +239,13 @@ public class PwmApplication
 
             pwmScheduler.immediateExecuteRunnableInNewThread( this::postInitTasks, sessionLabel, this.getClass().getSimpleName() + " postInit tasks" );
         }
-
     }
 
     public void reInit( final PwmEnvironment pwmEnvironment )
             throws PwmException
     {
         final Instant startTime = Instant.now();
-        LOGGER.debug( sessionLabel, () -> "beginning application restart" );
+        LOGGER.trace( sessionLabel, () -> "beginning application restart" );
         final AppConfig oldConfig = this.pwmEnvironment.getConfig();
         this.pwmEnvironment = pwmEnvironment;
         final AppConfig newConfig = this.pwmEnvironment.getConfig();
@@ -259,12 +254,16 @@ public class PwmApplication
         {
             processPwmAppRestart( );
         }
+        else
+        {
+            LOGGER.debug( sessionLabel, () -> "no system-level settings have been changed, restart of system services is not required");
+        }
 
         domains = PwmDomainUtil.reInitDomains( this, newConfig, oldConfig );
 
         runtimeNonce = PwmRandom.getInstance().randomUUID().toString();
 
-        LOGGER.debug( sessionLabel, () -> "completed application restart", () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.debug( sessionLabel, () -> "completed application restart with " + domains().size() + " domains", TimeDuration.fromCurrent( startTime ) );
     }
 
     private void postInitTasks()
@@ -288,6 +287,10 @@ public class PwmApplication
         PwmApplicationUtil.outputKeystore( this );
         PwmApplicationUtil.outputTomcatConf( this );
 
+        LOGGER.debug( sessionLabel, () -> "application environment flags: " + JsonFactory.get().serializeCollection( pwmEnvironment.getFlags() ) );
+        LOGGER.debug( sessionLabel, () -> "application environment parameters: "
+                + JsonFactory.get().serializeMap( pwmEnvironment.getParameters(), PwmEnvironment.ApplicationParameter.class, String.class ) );
+
         if ( LOGGER.isEnabled( PwmLogLevel.TRACE )
                 && Boolean.parseBoolean( getConfig().readAppProperty( AppProperty.LOGGING_OUTPUT_CONFIGURATION ) ) )
         {
@@ -302,7 +305,7 @@ public class PwmApplication
 
         PwmSettingMetaDataReader.initCache();
 
-        LOGGER.trace( sessionLabel, () -> "completed post init tasks", () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.trace( sessionLabel, () -> "completed post init tasks", TimeDuration.fromCurrent( startTime ) );
     }
 
     public static PwmApplication createPwmApplication( final PwmEnvironment pwmEnvironment )
@@ -393,7 +396,7 @@ public class PwmApplication
             final Instant startDomainShutdown = Instant.now();
             LOGGER.trace( sessionLabel, () -> "beginning shutdown of " + callables.size() + " running domains" );
             pwmScheduler.executeImmediateThreadPerJobAndAwaitCompletion( DOMAIN_STARTUP_THREADS, callables, sessionLabel, PwmApplication.class );
-            LOGGER.trace( sessionLabel, () -> "shutdown of " + callables.size() + " running domains completed", () -> TimeDuration.fromCurrent( startDomainShutdown ) );
+            LOGGER.trace( sessionLabel, () -> "shutdown of " + callables.size() + " running domains completed", TimeDuration.fromCurrent( startDomainShutdown ) );
         }
         catch ( final PwmUnrecoverableException e )
         {
@@ -425,7 +428,7 @@ public class PwmApplication
                 final TimeDuration closeLocalDbDuration = TimeDuration.fromCurrent( startCloseDbTime );
                 if ( closeLocalDbDuration.isLongerThan( TimeDuration.SECONDS_10 ) )
                 {
-                    LOGGER.info( sessionLabel, () -> "completed close of LocalDB", () -> closeLocalDbDuration );
+                    LOGGER.info( sessionLabel, () -> "completed close of LocalDB", closeLocalDbDuration );
                 }
             }
             catch ( final Exception e )
@@ -443,7 +446,7 @@ public class PwmApplication
         pwmScheduler.shutdown();
 
         LOGGER.info( sessionLabel, () -> PwmConstants.PWM_APP_NAME + " " + PwmConstants.SERVLET_VERSION
-                + " closed for bidness, cya!", () -> TimeDuration.fromCurrent( startTime ) );
+                + " closed for bidness, cya!", TimeDuration.fromCurrent( startTime ) );
     }
 
     public String getInstanceID( )

+ 3 - 3
server/src/main/java/password/pwm/PwmApplicationUtil.java

@@ -310,7 +310,7 @@ class PwmApplicationUtil
 
         final long itemCount = debugStrings.size();
         LOGGER.trace( pwmApplication.getSessionLabel(), () -> "--end current configuration output of " + itemCount + " items --",
-                () -> TimeDuration.fromCurrent( startTime ) );
+                TimeDuration.fromCurrent( startTime ) );
     }
 
     static void outputNonDefaultPropertiesToLog( final PwmApplication pwmApplication )
@@ -325,7 +325,7 @@ class PwmApplicationUtil
                     .map( entry -> "AppProperty: " + entry.getKey().getKey() + " -> " + entry.getValue() )
                     .map( s -> ( Supplier<CharSequence> ) () -> s )
                     .forEach( s -> LOGGER.trace( pwmApplication.getSessionLabel(), s ) );
-            LOGGER.trace( pwmApplication.getSessionLabel(), () -> "--end non-default app properties output--", () -> TimeDuration.fromCurrent( startTime ) );
+            LOGGER.trace( pwmApplication.getSessionLabel(), () -> "--end non-default app properties output--", TimeDuration.fromCurrent( startTime ) );
         }
         else
         {
@@ -345,7 +345,7 @@ class PwmApplicationUtil
                     .map( entry -> "AppProperty: " + entry.getKey().getLabel() + " -> " + entry.getValue() )
                     .map( s -> ( Supplier<CharSequence> ) () -> s )
                     .forEach( s -> LOGGER.trace( pwmApplication.getSessionLabel(), s ) );
-            LOGGER.trace( pwmApplication.getSessionLabel(), () -> "--end application info--", () -> TimeDuration.fromCurrent( startTime ) );
+            LOGGER.trace( pwmApplication.getSessionLabel(), () -> "--end application info--", TimeDuration.fromCurrent( startTime ) );
         }
         else
         {

+ 2 - 2
server/src/main/java/password/pwm/PwmDomain.java

@@ -101,7 +101,7 @@ public class PwmDomain
             PwmApplicationUtil.outputConfigurationToLog( pwmApplication, domainID );
         }
 
-        LOGGER.trace( sessionLabel, () -> "completed initializing domain " + domainID.stringValue(), () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.trace( sessionLabel, () -> "completed initializing domain " + domainID.stringValue(), TimeDuration.fromCurrent( startTime ) );
     }
 
     public DomainConfig getConfig( )
@@ -251,7 +251,7 @@ public class PwmDomain
         LOGGER.trace( sessionLabel, () -> "beginning shutdown domain " + domainID.stringValue() );
         TimeDuration.SECONDS_10.pause();
         pwmServiceManager.shutdownAllServices();
-        LOGGER.trace( sessionLabel, () -> "shutdown domain " + domainID.stringValue() + " completed", () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.trace( sessionLabel, () -> "shutdown domain " + domainID.stringValue() + " completed", TimeDuration.fromCurrent( startTime ) );
     }
 
     public DomainID getDomainID()

+ 14 - 4
server/src/main/java/password/pwm/PwmDomainUtil.java

@@ -95,7 +95,7 @@ class PwmDomainUtil
             throw domainStartupException.get();
         }
 
-        LOGGER.trace( () -> "completed domain initialization for domains", () -> TimeDuration.fromCurrent( domainInitStartTime ) );
+        LOGGER.trace( () -> "completed domain initialization for domains", TimeDuration.fromCurrent( domainInitStartTime ) );
     }
 
     private static class DomainInitializingCallable implements Callable<Optional<PwmUnrecoverableException>>
@@ -151,10 +151,20 @@ class PwmDomainUtil
             returnDomainMap.put( modifiedDomainID, newDomain );
         }
 
+        if ( newDomains.isEmpty() && deletedDomains.isEmpty() )
+        {
+            LOGGER.debug( pwmApplication.getSessionLabel(), () -> "no domain-level settings have been changed, restart of domain services is not required");
+        }
 
-        initDomains( pwmApplication, newDomains );
+        if ( !newDomains.isEmpty() )
+        {
+            initDomains( pwmApplication, newDomains );
+        }
 
-        processDeletedDomains( pwmApplication, deletedDomains );
+        if ( !deletedDomains.isEmpty() )
+        {
+            processDeletedDomains( pwmApplication, deletedDomains );
+        }
 
         return Collections.unmodifiableMap( returnDomainMap );
     }
@@ -174,7 +184,7 @@ class PwmDomainUtil
                         LOGGER.trace( pwmApplication.getSessionLabel(), () -> "shutting down obsoleted domain services" );
                         deletedDomains.forEach( PwmDomain::shutdown );
                         LOGGER.debug( pwmApplication.getSessionLabel(), () -> "shut down obsoleted domain services completed",
-                                () -> TimeDuration.fromCurrent( startTime ) );
+                                TimeDuration.fromCurrent( startTime ) );
                     },
                     pwmApplication.getSessionLabel(),
                     "obsoleted domain cleanup" );

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

@@ -202,7 +202,7 @@ public class PwmSettingMetaDataReader
             pwmSettingCategory.getLevel();
             pwmSettingCategory.getSettings();
         }
-        LOGGER.trace( () -> "completed PwmSetting xml cache initialization", () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.trace( () -> "completed PwmSetting xml cache initialization", TimeDuration.fromCurrent( startTime ) );
     }
 
     private static class InternalReader

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

@@ -182,7 +182,7 @@ public class LdapProfile extends AbstractProfile implements Profile
                 {
                     final String finalCanonical = canonicalValue;
                     LOGGER.trace( () -> "read and cached canonical ldap DN value for input '" + dnValue + "' as '" + finalCanonical + "'",
-                            () -> TimeDuration.fromCurrent( startTime ) );
+                            TimeDuration.fromCurrent( startTime ) );
                 }
             }
             catch ( final ChaiUnavailableException | ChaiOperationException e )

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

@@ -180,7 +180,7 @@ public class ConfigurationFileManager
         }
 
         final String fileSize = StringUtil.formatDiskSize( configFile.length() );
-        LOGGER.debug( () -> "configuration reading/parsing of " + fileSize + " complete", () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.debug( () -> "configuration reading/parsing of " + fileSize + " complete", TimeDuration.fromCurrent( startTime ) );
 
 
         final Optional<String> configIsEditable = storedConfiguration.readConfigProperty( ConfigurationProperty.CONFIG_IS_EDITABLE );
@@ -298,7 +298,7 @@ public class ConfigurationFileManager
         }
 
         final int finalChangeCount = changeCount;
-        LOGGER.debug( () -> "sent " + finalChangeCount + " audit notifications about changed settings", () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.debug( () -> "sent " + finalChangeCount + " audit notifications about changed settings", TimeDuration.fromCurrent( startTime ) );
     }
 
     private void outputConfigurationFile(
@@ -322,7 +322,7 @@ public class ConfigurationFileManager
             StoredConfigurationFactory.output( storedConfiguration, fileOutputStream );
         }
 
-        LOGGER.info( () -> "saved configuration", () -> TimeDuration.fromCurrent( saveFileStartTime ) );
+        LOGGER.info( () -> "saved configuration", TimeDuration.fromCurrent( saveFileStartTime ) );
         if ( pwmApplication != null )
         {
             final String actualChecksum = StoredConfigurationUtil.valueHash( storedConfiguration );

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

@@ -192,7 +192,7 @@ public abstract class StoredConfigurationUtil
                 .collect( Collectors.toList() );
 
 
-        LOGGER.trace( () -> "StoredConfiguration validator completed", () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.trace( () -> "StoredConfiguration validator completed", TimeDuration.fromCurrent( startTime ) );
         return Collections.unmodifiableList( errorStrings );
     }
 
@@ -337,7 +337,7 @@ public abstract class StoredConfigurationUtil
                 .filter( hashTester )
                 .collect( Collectors.toUnmodifiableSet() );
 
-        LOGGER.trace( () -> "generated " + deltaReferences.size() + " changeLog items via compare", () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.trace( () -> "generated " + deltaReferences.size() + " changeLog items via compare", TimeDuration.fromCurrent( startTime ) );
 
         return deltaReferences;
     }
@@ -496,7 +496,7 @@ public abstract class StoredConfigurationUtil
         }
 
         LOGGER.trace( () -> "copied " + modifier.modificationCount() + " domain settings from '" + source + "' to '" + destination + "' domain",
-                () -> TimeDuration.fromCurrent( startTime ) );
+                TimeDuration.fromCurrent( startTime ) );
 
         return modifier.newStoredConfiguration();
     }
@@ -521,7 +521,7 @@ public abstract class StoredConfigurationUtil
             throw new IllegalStateException( e );
         }
 
-        LOGGER.trace( () -> "calculated StoredConfiguration hash: " + output, () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.trace( () -> "calculated StoredConfiguration hash: " + output, TimeDuration.fromCurrent( startTime ) );
         return output;
     }
 

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

@@ -169,7 +169,7 @@ public class HealthService extends AbstractPwmService implements PwmService
             final TimeDuration checkDuration = TimeDuration.fromCurrent( startTime );
             averageStats.update( AverageStatKey.checkProcessTime, checkDuration.asDuration() );
             counterStats.increment( CounterStatKey.checks );
-            LOGGER.trace( () ->  "exit force immediate check, done=" + future.isDone(), () -> checkDuration );
+            LOGGER.trace( () ->  "exit force immediate check, done=" + future.isDone(), checkDuration );
         }
 
         getPwmApplication().getPwmScheduler().scheduleJob( new UpdateJob(), executorService, settings.getNominalCheckInterval() );
@@ -244,7 +244,7 @@ public class HealthService extends AbstractPwmService implements PwmService
         }
 
         healthData = new HealthData( Collections.unmodifiableSet( new TreeSet<>( tempResults ) ), Instant.now() );
-        LOGGER.trace( () -> "completed health check execution #" + counter, () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.trace( () -> "completed health check execution #" + counter, TimeDuration.fromCurrent( startTime ) );
     }
 
     private static List<Supplier<List<HealthRecord>>> gatherSuppliers(
@@ -319,7 +319,7 @@ public class HealthService extends AbstractPwmService implements PwmService
             {
                 final Instant startTime = Instant.now();
                 doHealthChecks();
-                LOGGER.trace( () -> "completed health check dredge", () -> TimeDuration.fromCurrent( startTime ) );
+                LOGGER.trace( () -> "completed health check dredge", TimeDuration.fromCurrent( startTime ) );
             }
             catch ( final Throwable e )
             {

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

@@ -540,11 +540,7 @@ public class ContextManager implements Serializable
                     LOGGER.fatal( () -> "unexpected error during shutdown: " + e.getMessage(), e );
                 }
 
-
-                {
-                    final TimeDuration timeDuration = TimeDuration.fromCurrent( startTime );
-                    LOGGER.info( SESSION_LABEL, () -> "application restart completed", () -> timeDuration );
-                }
+                LOGGER.info( SESSION_LABEL, () -> "application restart completed", TimeDuration.fromCurrent( startTime ) );
             }
             finally
             {

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

@@ -401,7 +401,7 @@ public class PwmRequest extends PwmHttpRequestWrapper
         return pwmURL;
     }
 
-    public void debugHttpRequestToLog( final String extraText, final Supplier<TimeDuration> timeDuration )
+    public void debugHttpRequestToLog( final String extraText, final TimeDuration timeDuration )
             throws PwmUnrecoverableException
     {
         if ( LOGGER.isEnabled( PwmLogLevel.TRACE ) )

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

@@ -135,7 +135,7 @@ public class SessionFilter extends AbstractPwmFilter
         }
 
         final TimeDuration requestExecuteTime = TimeDuration.fromCurrent( startTime );
-        pwmRequest.debugHttpRequestToLog( "completed", () -> requestExecuteTime );
+        pwmRequest.debugHttpRequestToLog( "completed", requestExecuteTime );
         pwmRequest.getPwmDomain().getStatisticsManager().updateAverageValue( AvgStatistic.AVG_REQUEST_PROCESS_TIME, requestExecuteTime.asMillis() );
         pwmRequest.getPwmSession().getSessionStateBean().getRequestCount().incrementAndGet();
         pwmRequest.getPwmSession().getSessionStateBean().getAvgRequestDuration().update( requestExecuteTime.asDuration() );

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

@@ -97,7 +97,7 @@ public class AccountInformationBean implements Serializable
         ) );
         builder.passwordRules( makePasswordRules( pwmRequest ) );
 
-        LOGGER.trace( pwmRequest, () -> "generated account information bean in ", () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.trace( pwmRequest, () -> "generated account information bean in ", TimeDuration.fromCurrent( startTime ) );
         return builder.build();
     }
 

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

@@ -211,7 +211,7 @@ public class AppDashboardData implements Serializable
         builder.sessionCount( pwmDomain.getSessionTrackService().sessionCount() );
         builder.requestsInProgress( pwmDomain.getPwmApplication().getActiveServletRequests().get() );
 
-        LOGGER.trace( () -> "AppDashboardData bean created", () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.trace( () -> "AppDashboardData bean created", TimeDuration.fromCurrent( startTime ) );
         return builder.build();
     }
 

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

@@ -151,7 +151,7 @@ public class ConfigEditorServletUtils
                                     record.getDomainID(), k -> new ArrayList<>() )
                             .add( record.getDetail( locale, pwmRequest.getAppConfig() ) ) );
 
-            LOGGER.debug( () -> "config health check done in ", () -> TimeDuration.fromCurrent( startTime ) );
+            LOGGER.debug( () -> "config health check done in ", TimeDuration.fromCurrent( startTime ) );
 
             return Collections.unmodifiableMap( returnData );
         }

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/configeditor/data/NavTreeDataMaker.java

@@ -87,7 +87,7 @@ public class NavTreeDataMaker
         LOGGER.trace( () -> "generated " + navigationData.size()
                         + " navTreeItems for display menu with settings"
                         + JsonFactory.get().serialize( navTreeSettings ),
-                () -> TimeDuration.fromCurrent( startTime ) );
+                TimeDuration.fromCurrent( startTime ) );
         return Collections.unmodifiableList( navigationData );
     }
 

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/configeditor/data/SettingDataMaker.java

@@ -108,7 +108,7 @@ public class SettingDataMaker
 
         LOGGER.trace( sessionLabel, () -> "generated settingData with "
                 + settingData.getSettings().size() + " settings and "
-                + settingData.getCategories().size() + " categories", () -> TimeDuration.fromCurrent( startGenerateTime ) );
+                + settingData.getCategories().size() + " categories", TimeDuration.fromCurrent( startGenerateTime ) );
 
         return settingData;
     }

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

@@ -240,7 +240,7 @@ public class NewUserServlet extends ControlledPwmServlet
         {
             final Instant startTime = Instant.now();
             newUserProfile.getNewUserPasswordPolicy( pwmRequest.getPwmRequestContext() );
-            LOGGER.trace( () -> "read new user password policy in ", () -> TimeDuration.fromCurrent( startTime ) );
+            LOGGER.trace( () -> "read new user password policy in ", TimeDuration.fromCurrent( startTime ) );
         }
 
         if ( !newUserBean.isFormPassed() )
@@ -470,7 +470,7 @@ public class NewUserServlet extends ControlledPwmServlet
             passwordCheckInfo = new PasswordUtility.PasswordCheckInfo( null, true, 0, PasswordUtility.PasswordCheckInfo.MatchStatus.MATCH, 0 );
         }
 
-        LOGGER.trace( () -> "competed form validation in ", () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.trace( () -> "competed form validation in ", TimeDuration.fromCurrent( startTime ) );
         return passwordCheckInfo;
     }
 

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

@@ -638,7 +638,7 @@ class PeopleSearchDataReader
         }
         finally
         {
-            LOGGER.trace( pwmRequest, () -> "completed checkIfUserViewable for " + userIdentity.toDisplayString() + " in ", () -> TimeDuration.fromCurrent( startTime ) );
+            LOGGER.trace( pwmRequest, () -> "completed checkIfUserViewable for " + userIdentity.toDisplayString() + " in ", TimeDuration.fromCurrent( startTime ) );
         }
     }
 

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

@@ -155,7 +155,7 @@ public class ResourceFileServlet extends HttpServlet implements PwmServlet
                 debugText = makeDebugText( fromCache, acceptsGzip, true );
             }
 
-            pwmRequest.debugHttpRequestToLog( debugText, () -> TimeDuration.fromCurrent( pwmRequest.getRequestStartTime() ) );
+            pwmRequest.debugHttpRequestToLog( debugText, TimeDuration.fromCurrent( pwmRequest.getRequestStartTime() ) );
 
             StatisticsClient.incrementStat( pwmDomain, Statistic.HTTP_RESOURCE_REQUESTS );
             resourceService.getAverageStats().update( ResourceServletService.AverageStat.cacheHitRatio, fromCache ? 1 : 0 );

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

@@ -164,7 +164,7 @@ public class ResourceServletService extends AbstractPwmService implements PwmSer
         {
             final Instant start = Instant.now();
             resourceNonce = makeResourcePathNonce();
-            LOGGER.trace( getSessionLabel(), () -> "calculated nonce", () -> TimeDuration.fromCurrent( start ) );
+            LOGGER.trace( getSessionLabel(), () -> "calculated nonce", TimeDuration.fromCurrent( start ) );
         }
         catch ( final Exception e )
         {
@@ -214,7 +214,7 @@ public class ResourceServletService extends AbstractPwmService implements PwmSer
 
         final Instant startTime = Instant.now();
         final String nonce = checksumAllResources( pwmDomain );
-        LOGGER.debug( getSessionLabel(), () -> "completed generation of nonce '" + nonce + "'", () ->  TimeDuration.fromCurrent( startTime ) );
+        LOGGER.debug( getSessionLabel(), () -> "completed generation of nonce '" + nonce + "'", TimeDuration.fromCurrent( startTime ) );
 
         final String noncePrefix = pwmDomain.getConfig().readAppProperty( AppProperty.HTTP_RESOURCES_NONCE_PATH_PREFIX );
         return "/" + noncePrefix + nonce;

+ 2 - 2
server/src/main/java/password/pwm/ldap/permission/UserPermissionUtility.java

@@ -126,7 +126,7 @@ public class UserPermissionUtility
         LOGGER.debug( sessionLabel, () -> "user " + userIdentity.toDisplayString() + " is "
                         + ( match ? "" : "not " )
                         + "a match for permission '" + userPermission + "'",
-                () -> TimeDuration.fromCurrent( startTime ) );
+                TimeDuration.fromCurrent( startTime ) );
         return match;
     }
 
@@ -230,7 +230,7 @@ public class UserPermissionUtility
             LOGGER.debug(
                     sessionLabel,
                     () -> "stripped " + removedValues + " user(s) from set of " + userIdentities.size() + " permission matches",
-                    () -> TimeDuration.fromCurrent( startTime ) );
+                    TimeDuration.fromCurrent( startTime ) );
         }
         return Collections.unmodifiableList( output );
     }

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

@@ -124,7 +124,7 @@ public class PwmServiceManager
 
         initialized = true;
 
-        LOGGER.trace( sessionLabel, () -> logVerb + "ed services, " + statCounter.debugStats(), () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.trace( sessionLabel, () -> logVerb + "ed services, " + statCounter.debugStats(), TimeDuration.fromCurrent( startTime ) );
     }
 
     private PwmService initService( final PwmServiceEnum pwmServiceEnum )
@@ -194,7 +194,7 @@ public class PwmServiceManager
         }
         initialized = false;
 
-        LOGGER.trace( sessionLabel, () -> "closed all services", () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.trace( sessionLabel, () -> "closed all services", TimeDuration.fromCurrent( startTime ) );
     }
 
     private void shutDownService( final PwmServiceEnum pwmServiceEnum, final PwmService serviceInstance )

+ 1 - 1
server/src/main/java/password/pwm/svc/cr/CrService.java

@@ -173,7 +173,7 @@ public class CrService extends AbstractPwmService implements PwmService
                         LOGGER.debug( sessionLabel, () -> "using ldap c/r policy for user " + theUser.getEntryDN() + ": "
                                 + finalReturnSet );
                         LOGGER.trace( sessionLabel, () -> "readUserChallengeProfile completed, result=" + JsonFactory.get().serialize( challengeProfile ),
-                                () -> TimeDuration.fromCurrent( methodStartTime ) );
+                                TimeDuration.fromCurrent( methodStartTime ) );
 
                         return challengeProfile;
                     }

+ 1 - 1
server/src/main/java/password/pwm/svc/cr/LdapCrOperator.java

@@ -166,7 +166,7 @@ public class LdapCrOperator implements CrOperator
                     responseInfoBean.getCsIdentifier()
             );
             ChaiCrFactory.writeChaiResponseSet( responseSet, theUser );
-            LOGGER.info( sessionLabel, () -> "saved responses for user to chai-ldap format", () -> TimeDuration.fromCurrent( startTime ) );
+            LOGGER.info( sessionLabel, () -> "saved responses for user to chai-ldap format", TimeDuration.fromCurrent( startTime ) );
         }
         catch ( final ChaiException e )
         {

+ 1 - 1
server/src/main/java/password/pwm/svc/email/EmailConnectionPool.java

@@ -108,7 +108,7 @@ public class EmailConnectionPool
             final EmailConnection emailConnection = getSmtpTransport();
             LOGGER.trace( () -> "created new email connection " + emailConnection.getId()
                             + " to " + emailConnection.getEmailServer().getId(),
-                    () -> TimeDuration.fromCurrent( startTime ) );
+                    TimeDuration.fromCurrent( startTime ) );
             activeConnectionCounter.incrementAndGet();
             return emailConnection;
         }

+ 1 - 1
server/src/main/java/password/pwm/svc/email/EmailServerUtil.java

@@ -395,7 +395,7 @@ public class EmailServerUtil
         }
 
         LOGGER.debug( () -> "connected to " + server.toDebugString() + " " + ( authenticated ? "(authenticated)" : "(unauthenticated)" ),
-                () -> TimeDuration.fromCurrent( startTime ) );
+                TimeDuration.fromCurrent( startTime ) );
 
         return transport;
     }

+ 1 - 1
server/src/main/java/password/pwm/svc/email/EmailService.java

@@ -521,7 +521,7 @@ public class EmailService extends AbstractPwmService implements PwmService
             emailConnection.getEmailServer().getAverageSendTime().update( sendTime.asMillis() );
             lastSendError.set( null );
 
-            LOGGER.debug( () -> "sent email: " + emailItemBean.toDebugString(), () -> sendTime );
+            LOGGER.debug( () -> "sent email: " + emailItemBean.toDebugString(), sendTime );
             StatisticsClient.incrementStat( getPwmApplication(), Statistic.EMAIL_SEND_SUCCESSES );
         }
         catch ( final MessagingException | PwmException e )

+ 1 - 1
server/src/main/java/password/pwm/svc/httpclient/JavaPwmHttpClient.java

@@ -217,7 +217,7 @@ public class JavaPwmHttpClient implements PwmHttpClientProvider
         httpClientService.getStats().increment( HttpClientService.StatsKey.responseBytes, pwmHttpClientResponse.size() );
         httpClientService.getStats().increment( HttpClientService.StatsKey.requestBytes, pwmHttpClientRequest.size() );
         LOGGER.trace( sessionLabel, () -> "client #" + clientID + " received response (id=" + pwmHttpClientRequest.getRequestID() + ") "
-                + pwmHttpClientResponse.toDebugString( pwmApplication, pwmHttpClientConfiguration ), () -> TimeDuration.fromCurrent( startTime ) );
+                + pwmHttpClientResponse.toDebugString( pwmApplication, pwmHttpClientConfiguration ), TimeDuration.fromCurrent( startTime ) );
     }
 
     private static Optional<HttpContentType> contentTypeForResponse( final HttpHeaders httpHeaders )

+ 1 - 1
server/src/main/java/password/pwm/svc/otp/OtpService.java

@@ -355,7 +355,7 @@ public class OtpService extends AbstractPwmService implements PwmService
                     : "loaded otp record for user " + userIdentity.toDisplayString()
                     + " [recordType=" + finalOtpConfig.getType() + ", identifier=" + finalOtpConfig.getIdentifier() + ", timestamp="
                     + StringUtil.toIsoDate( finalOtpConfig.getTimestamp() ) + "]";
-            LOGGER.trace( sessionLabel, msg, () -> TimeDuration.fromCurrent(  methodStartTime ) );
+            LOGGER.trace( sessionLabel, msg, TimeDuration.fromCurrent(  methodStartTime ) );
         }
 
         return otpConfig;

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

@@ -371,7 +371,7 @@ public class ReportService extends AbstractPwmService implements PwmService
                 LOGGER.trace(
                         getSessionLabel(),
                         () -> "completed ldap search process with for domain '" + pwmDomain.getDomainID() + "'",
-                        () -> TimeDuration.fromCurrent( loopStartTime ) );
+                        TimeDuration.fromCurrent( loopStartTime ) );
 
                 writeUsersToLocalDBQueue( searchResults );
             }
@@ -379,7 +379,7 @@ public class ReportService extends AbstractPwmService implements PwmService
             LOGGER.trace(
                     getSessionLabel(),
                     () -> "completed ldap search process with entries for " + getPwmApplication().domains().size() + " domains",
-                    () -> TimeDuration.fromCurrent( startTime ) );
+                    TimeDuration.fromCurrent( startTime ) );
 
         }
 
@@ -409,7 +409,7 @@ public class ReportService extends AbstractPwmService implements PwmService
                 transactionCalculator.recordLastTransactionDuration( TimeDuration.fromCurrent( loopStart ) );
             }
             LOGGER.trace( getSessionLabel(),
-                    () -> "completed transfer of ldap search results to work queue", () -> TimeDuration.fromCurrent( startTime ) );
+                    () -> "completed transfer of ldap search results to work queue", TimeDuration.fromCurrent( startTime ) );
         }
     }
 
@@ -556,7 +556,7 @@ public class ReportService extends AbstractPwmService implements PwmService
                 summaryData.update( newUserReportRecord.get() );
                 processRateMeter.markEvents( 1 );
 
-                LOGGER.trace( getSessionLabel(), () -> "stored cache for " + userIdentity, () -> TimeDuration.fromCurrent( startTime ) );
+                LOGGER.trace( getSessionLabel(), () -> "stored cache for " + userIdentity, TimeDuration.fromCurrent( startTime ) );
             }
         }
 

+ 1 - 1
server/src/main/java/password/pwm/svc/sessiontrack/UserAgentUtils.java

@@ -87,7 +87,7 @@ public class UserAgentUtils
     {
         final Instant startTime = Instant.now();
         CACHED_PARSER.get();
-        LOGGER.trace( () -> "loaded useragent parser", () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.trace( () -> "loaded useragent parser", TimeDuration.fromCurrent( startTime ) );
     }
 
     public static void checkIfPreIE11( final PwmRequest pwmRequest ) throws PwmUnrecoverableException

+ 1 - 1
server/src/main/java/password/pwm/svc/telemetry/FtpTelemetrySender.java

@@ -172,7 +172,7 @@ public class FtpTelemetrySender implements TelemetrySender
                 throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_TELEMETRY_SEND_ERROR, msg ) );
             }
 
-            LOGGER.trace( sessionLabel, () -> "completed transfer of " + fileBytes.length + " in ", () -> TimeDuration.fromCurrent( startTime ) );
+            LOGGER.trace( sessionLabel, () -> "completed transfer of " + fileBytes.length + " in ", TimeDuration.fromCurrent( startTime ) );
         }
         catch ( final IOException e )
         {

+ 1 - 1
server/src/main/java/password/pwm/svc/token/DataStoreTokenMachine.java

@@ -104,7 +104,7 @@ public class DataStoreTokenMachine implements TokenMachine
         }
         {
             final long finalSize = size();
-            LOGGER.trace( () -> "completed record purge cycle; database size = " + finalSize, () -> TimeDuration.fromCurrent( startTime ) );
+            LOGGER.trace( () -> "completed record purge cycle; database size = " + finalSize, TimeDuration.fromCurrent( startTime ) );
         }
     }
 

+ 1 - 1
server/src/main/java/password/pwm/svc/userhistory/UserHistoryService.java

@@ -169,7 +169,7 @@ public class UserHistoryService extends AbstractPwmService implements PwmService
     {
         final Instant startTime = Instant.now();
         final List<UserAuditRecord> results = userHistoryStore.readUserHistory( sessionLabel, userInfoBean );
-        LOGGER.trace( sessionLabel, () -> "read " + results.size() + " user history records", () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.trace( sessionLabel, () -> "read " + results.size() + " user history records", TimeDuration.fromCurrent( startTime ) );
         return results;
     }
 

+ 1 - 1
server/src/main/java/password/pwm/svc/wordlist/AbstractWordlist.java

@@ -398,7 +398,7 @@ abstract class AbstractWordlist extends AbstractPwmService implements Wordlist,
         activity = Wordlist.Activity.Clearing;
         writeWordlistStatus( WordlistStatus.builder().build() );
         getWordlistBucket().clear();
-        getLogger().debug( getSessionLabel(), () -> "cleared stored wordlist", () -> TimeDuration.fromCurrent( startTime ) );
+        getLogger().debug( getSessionLabel(), () -> "cleared stored wordlist", TimeDuration.fromCurrent( startTime ) );
         setActivity( postCleanActivity );
     }
 

+ 2 - 2
server/src/main/java/password/pwm/svc/wordlist/SharedHistoryService.java

@@ -222,7 +222,7 @@ public class SharedHistoryService extends AbstractPwmService implements PwmServi
             LOGGER.debug( getSessionLabel(), () -> "open with " + size + " words"
                     + ", maxAgeMs=" + maxAge.asCompactString()
                     + ", oldestEntry=" + TimeDuration.fromCurrent( oldestEntry ).asCompactString(),
-                    () -> TimeDuration.fromCurrent( startTime ) );
+                    TimeDuration.fromCurrent( startTime ) );
         }
         catch ( final LocalDBException e )
         {
@@ -405,7 +405,7 @@ public class SharedHistoryService extends AbstractPwmService implements PwmServi
                 LOGGER.debug( getSessionLabel(), () -> "completed wordDB reduce operation" + ", removed=" + finalRemove
                         + ", totalRemaining=" + size()
                         + ", oldestEntry=" + oldestEntry
-                        + " in ", () -> TimeDuration.fromCurrent( startTime ) );
+                        + " in ", TimeDuration.fromCurrent( startTime ) );
             }
         }
     }

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

@@ -367,7 +367,7 @@ class WordlistImporter implements Runnable
         final long wordlistSize = wordlistBucket.size();
 
         getLogger().info( rootWordlist.getSessionLabel(), () -> "population complete, added " + wordlistSize
-                + " total words", this::getImportDuration );
+                + " total words", this.getImportDuration() );
 
         completed = true;
         writeCurrentWordlistStatus();

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

@@ -183,7 +183,7 @@ class WordlistSource
 
         final Map<HttpHeader, String> finalReturnResponses =  Collections.unmodifiableMap( returnResponses );
         pwmLogger.debug( sessionLabel, () -> "read remote header info for " + this.getWordlistSourceType() + " wordlist: "
-                + JsonFactory.get().serializeMap( finalReturnResponses ), () -> TimeDuration.fromCurrent( startTime ) );
+                + JsonFactory.get().serializeMap( finalReturnResponses ), TimeDuration.fromCurrent( startTime ) );
         return finalReturnResponses;
     }
 
@@ -285,7 +285,7 @@ class WordlistSource
                                 + getWordlistSourceType() + " wordlist"
                                 + " " + StringUtil.formatDiskSize( wordlistZipReader.getByteCount() ) + " read"
                                 + bytesPerSecondStr().orElse( "" ),
-                        () -> TimeDuration.fromCurrent( startTime ) );
+                        TimeDuration.fromCurrent( startTime ) );
             }
 
             private Optional<String> bytesPerSecondStr()
@@ -317,7 +317,7 @@ class WordlistSource
             JavaHelper.closeQuietly( inputStream );
         }
         pwmLogger.trace( sessionLabel, () -> processIdLabel( processId ) + "completed close of remote wordlist read process",
-                () -> TimeDuration.fromCurrent( startClose ) );
+                TimeDuration.fromCurrent( startClose ) );
     }
 
     private String processIdLabel( final int processId )

+ 2 - 1
server/src/main/java/password/pwm/util/MBeanUtility.java

@@ -25,6 +25,7 @@ import lombok.Getter;
 import password.pwm.PwmAboutProperty;
 import password.pwm.PwmApplication;
 import password.pwm.PwmConstants;
+import password.pwm.util.java.JavaHelper;
 import password.pwm.util.logging.PwmLogger;
 
 import javax.management.Attribute;
@@ -78,7 +79,7 @@ public class MBeanUtility
         }
         catch ( final Exception e )
         {
-            LOGGER.debug( () -> "error unregistering mbean: " + e.getMessage() );
+            LOGGER.debug( () -> "error unregistering mbean: " + JavaHelper.readHostileExceptionMessage( e ) );
         }
     }
 

+ 1 - 1
server/src/main/java/password/pwm/util/debug/DebugItemGenerator.java

@@ -137,7 +137,7 @@ public class DebugItemGenerator
         {
             final String msg = "completed";
             debugGeneratorLogFile.appendLine( msg );
-            LOGGER.trace( sessionLabel, () -> msg, () ->  TimeDuration.fromCurrent( startTime ) );
+            LOGGER.trace( sessionLabel, () -> msg, TimeDuration.fromCurrent( startTime ) );
         }
 
         try

+ 1 - 1
server/src/main/java/password/pwm/util/debug/LogDebugItemGenerator.java

@@ -82,6 +82,6 @@ class LogDebugItemGenerator implements AppItemGenerator
         final Function<PwmLogEvent, String> logEventFormatter = PwmLogEvent::toLogString;
 
         outputLogs( debugItemInput.getPwmApplication(), outputStream, logEventFormatter );
-        LOGGER.trace( () -> "debug log output completed in ", () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.trace( () -> "debug log output completed in ", TimeDuration.fromCurrent( startTime ) );
     }
 }

+ 1 - 1
server/src/main/java/password/pwm/util/debug/LogJsonItemGenerator.java

@@ -48,6 +48,6 @@ class LogJsonItemGenerator implements AppItemGenerator
         final Function<PwmLogEvent, String> logEventFormatter = JsonFactory.get()::serialize;
 
         LogDebugItemGenerator.outputLogs( debugItemInput.getPwmApplication(), outputStream, logEventFormatter );
-        LOGGER.trace( () -> "debug json output completed in ", () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.trace( () -> "debug json output completed in ", TimeDuration.fromCurrent( startTime ) );
     }
 }

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

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

+ 6 - 7
server/src/main/java/password/pwm/util/localdb/WorkQueueProcessor.java

@@ -32,11 +32,11 @@ import password.pwm.util.EventRateMeter;
 import password.pwm.util.PwmScheduler;
 import password.pwm.util.java.AtomicLoopIntIncrementer;
 import password.pwm.util.java.JavaHelper;
-import password.pwm.util.json.JsonFactory;
 import password.pwm.util.java.MovingAverage;
 import password.pwm.util.java.StatisticCounterBundle;
 import password.pwm.util.java.StringUtil;
 import password.pwm.util.java.TimeDuration;
+import password.pwm.util.json.JsonFactory;
 import password.pwm.util.logging.PwmLogger;
 
 import java.io.Serializable;
@@ -56,7 +56,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.LockSupport;
 import java.util.concurrent.locks.ReentrantLock;
-import java.util.function.Supplier;
 
 /**
  * A work item queue manager.   Items submitted to the queue will eventually be worked on by the client side @code {@link ItemProcessor}.
@@ -223,7 +222,7 @@ public final class WorkQueueProcessor<W extends Serializable>
             final ProcessResult processResult = itemProcessor.process( itemWrapper.getWorkItem() );
             if ( processResult == ProcessResult.SUCCESS )
             {
-                logAndStatUpdateForSuccess( itemWrapper, () -> TimeDuration.fromCurrent( processStartTime ) );
+                logAndStatUpdateForSuccess( itemWrapper, TimeDuration.fromCurrent( processStartTime ) );
             }
             else if ( processResult == ProcessResult.RETRY || processResult == ProcessResult.NOOP )
             {
@@ -281,13 +280,13 @@ public final class WorkQueueProcessor<W extends Serializable>
         if ( attempts > 1 )
         {
             logger.trace( () -> "item submitted directly to queue: " + makeDebugText( itemWrapper ),
-                    () -> TimeDuration.fromCurrent( startTime ) );
+                    TimeDuration.fromCurrent( startTime ) );
         }
         else
         {
             final int finalAttempts = attempts;
             logger.debug( () -> "item submitted to queue after " + finalAttempts + " attempts: "
-                    + makeDebugText( itemWrapper ), () -> TimeDuration.fromCurrent( startTime ) );
+                    + makeDebugText( itemWrapper ), TimeDuration.fromCurrent( startTime ) );
         }
     }
 
@@ -485,7 +484,7 @@ public final class WorkQueueProcessor<W extends Serializable>
                         case SUCCESS:
                         {
                             removeQueueTop();
-                            logAndStatUpdateForSuccess( itemWrapper, () -> TimeDuration.fromCurrent( processStartTime ) );
+                            logAndStatUpdateForSuccess( itemWrapper, TimeDuration.fromCurrent( processStartTime ) );
                         }
                         break;
 
@@ -605,7 +604,7 @@ public final class WorkQueueProcessor<W extends Serializable>
         private TimeDuration maxShutdownWaitTime = TimeDuration.of( 30, TimeDuration.Unit.SECONDS );
     }
 
-    private void logAndStatUpdateForSuccess( final ItemWrapper<W> itemWrapper, final Supplier<TimeDuration> processDuration )
+    private void logAndStatUpdateForSuccess( final ItemWrapper<W> itemWrapper, final TimeDuration processDuration )
             throws PwmOperationalException
     {
         final TimeDuration lagTime = TimeDuration.fromCurrent( itemWrapper.getDate() );

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

@@ -251,7 +251,7 @@ public class LocalDBLogger extends AbstractPwmService implements PwmService
         setStatus( STATUS.CLOSED );
 
         final int finalFlushedEvents = flushedEvents;
-        LOGGER.trace( () -> "LocalDBLogger close completed (flushed during close: " + finalFlushedEvents + ")", () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.trace( () -> "LocalDBLogger close completed (flushed during close: " + finalFlushedEvents + ")", TimeDuration.fromCurrent( startTime ) );
     }
 
     public int getStoredEventCount( )

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

@@ -123,7 +123,8 @@ public class PwmLogger
             final PwmRequest pwmRequest,
             final Supplier<CharSequence> message,
             final Throwable e,
-            final Supplier<TimeDuration> timeDuration )
+            final TimeDuration timeDuration
+    )
     {
         if ( !isEnabled( level ) )
         {
@@ -166,7 +167,7 @@ public class PwmLogger
             final SessionLabel sessionLabel,
             final Supplier<CharSequence> message,
             final Throwable e,
-            final Supplier<TimeDuration> timeDuration
+            final TimeDuration timeDuration
     )
     {
         if ( !isEnabled( level ) )
@@ -182,7 +183,7 @@ public class PwmLogger
         doLogEvent( logEvent );
     }
 
-    private CharSequence formatEffectiveMessage( final Supplier<CharSequence> message, final Supplier<TimeDuration> timeDuration )
+    private CharSequence formatEffectiveMessage( final Supplier<CharSequence> message, final TimeDuration timeDuration )
     {
         final CharSequence output = message == null
                 ? ""
@@ -190,7 +191,7 @@ public class PwmLogger
 
         if ( timeDuration != null )
         {
-            return output + " (" + timeDuration.get().asCompactString() + ")";
+            return output + " (" + timeDuration.asCompactString() + ")";
         }
 
         return output;
@@ -287,7 +288,7 @@ public class PwmLogger
         doLogEvent( PwmLogLevel.TRACE, null, message, null );
     }
 
-    public void trace( final Supplier<CharSequence> message, final Supplier<TimeDuration> timeDuration )
+    public void trace( final Supplier<CharSequence> message, final TimeDuration timeDuration )
     {
         doLogEvent( PwmLogLevel.TRACE, null, message, null, timeDuration );
     }
@@ -297,7 +298,7 @@ public class PwmLogger
         doPwmRequestLogEvent( PwmLogLevel.TRACE, pwmRequest, message, null, null );
     }
 
-    public void trace( final PwmRequest pwmRequest, final Supplier<CharSequence> message, final Supplier<TimeDuration> timeDuration )
+    public void trace( final PwmRequest pwmRequest, final Supplier<CharSequence> message, final TimeDuration timeDuration )
     {
         doPwmRequestLogEvent( PwmLogLevel.TRACE, pwmRequest, message, null, timeDuration );
     }
@@ -317,7 +318,7 @@ public class PwmLogger
         doLogEvent( PwmLogLevel.TRACE, sessionLabel, message, null );
     }
 
-    public void trace( final SessionLabel sessionLabel, final Supplier<CharSequence> message, final Supplier<TimeDuration> timeDuration )
+    public void trace( final SessionLabel sessionLabel, final Supplier<CharSequence> message, final TimeDuration timeDuration )
     {
         doLogEvent( PwmLogLevel.TRACE, sessionLabel, message, null, timeDuration );
     }
@@ -332,7 +333,7 @@ public class PwmLogger
         doLogEvent( PwmLogLevel.DEBUG, null, message, null );
     }
 
-    public void debug( final Supplier<CharSequence> message, final Supplier<TimeDuration> timeDuration )
+    public void debug( final Supplier<CharSequence> message, final TimeDuration timeDuration )
     {
         doLogEvent( PwmLogLevel.DEBUG, null, message, null, timeDuration );
     }
@@ -352,7 +353,7 @@ public class PwmLogger
         doLogEvent( PwmLogLevel.DEBUG, sessionLabel, message, null );
     }
 
-    public void debug( final SessionLabel sessionLabel, final Supplier<CharSequence> message, final Supplier<TimeDuration> timeDuration )
+    public void debug( final SessionLabel sessionLabel, final Supplier<CharSequence> message, final TimeDuration timeDuration )
     {
         doLogEvent( PwmLogLevel.DEBUG, sessionLabel, message, null, timeDuration );
     }
@@ -372,7 +373,7 @@ public class PwmLogger
         doLogEvent( PwmLogLevel.INFO, null, message, null );
     }
 
-    public void info( final Supplier<CharSequence> message, final Supplier<TimeDuration> timeDuration )
+    public void info( final Supplier<CharSequence> message, final TimeDuration timeDuration )
     {
         doLogEvent( PwmLogLevel.INFO, null, message, null, timeDuration );
     }
@@ -392,7 +393,7 @@ public class PwmLogger
         doLogEvent( PwmLogLevel.INFO, sessionLabel, message, null );
     }
 
-    public void info( final SessionLabel sessionLabel, final Supplier<CharSequence> message, final Supplier<TimeDuration> timeDuration )
+    public void info( final SessionLabel sessionLabel, final Supplier<CharSequence> message, final TimeDuration timeDuration )
     {
         doLogEvent( PwmLogLevel.INFO, sessionLabel, message, null, timeDuration );
     }
@@ -432,7 +433,7 @@ public class PwmLogger
         doLogEvent( PwmLogLevel.ERROR, sessionLabel, message, null );
     }
 
-    public void error( final SessionLabel sessionLabel, final Supplier<CharSequence> message, final Supplier<TimeDuration> timeDurationSupplier )
+    public void error( final SessionLabel sessionLabel, final Supplier<CharSequence> message, final TimeDuration timeDurationSupplier )
     {
         doLogEvent( PwmLogLevel.ERROR, sessionLabel, message, null, timeDurationSupplier );
     }

+ 1 - 1
server/src/main/java/password/pwm/util/macro/MacroMachine.java

@@ -248,7 +248,7 @@ public class MacroMachine
                 final String finalReplaceStr = replaceStr;
                 LOGGER.trace( sessionLabel, () -> "replaced macro " + matchedStr + " with value: "
                                 + ( sensitive ? PwmConstants.LOG_REMOVED_VALUE_REPLACEMENT : finalReplaceStr ),
-                        () -> TimeDuration.fromCurrent( startTime ) );
+                        TimeDuration.fromCurrent( startTime ) );
             }
         }
         return new StringBuilder( input ).replace( startPos, endPos, replaceStr ).toString();

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

@@ -963,7 +963,7 @@ public class PasswordUtility
                 throw new IllegalStateException( "unknown policy source defined: " + ppSource.name() );
         }
 
-        LOGGER.trace( pwmSession, () -> "readPasswordPolicyForUser completed", () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.trace( pwmSession, () -> "readPasswordPolicyForUser completed", TimeDuration.fromCurrent( startTime ) );
         return returnPolicy;
     }
 

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

@@ -138,7 +138,7 @@ public class RandomPasswordGenerator
         if ( mutatorResult.isValidPassword() )
         {
             LOGGER.trace( sessionLabel, () -> "finished random password generation after " + mutatorResult.getTryCount()
-                    + " tries.", () -> TimeDuration.fromCurrent( startTime ) );
+                    + " tries.", TimeDuration.fromCurrent( startTime ) );
         }
         else
         {
@@ -149,7 +149,7 @@ public class RandomPasswordGenerator
                 final int judgeLevel = PasswordUtility.judgePasswordStrength( pwmDomain.getConfig(), mutatorResult.getPassword() );
                 LOGGER.error( sessionLabel, () -> "failed random password generation after "
                                 + mutatorResult.getTryCount() + " tries. " + "(errors=" + errors + ", judgeLevel=" + judgeLevel,
-                        () -> TimeDuration.fromCurrent( startTime ) );
+                        TimeDuration.fromCurrent( startTime ) );
             }
         }
 

+ 1 - 1
server/src/main/java/password/pwm/ws/server/RestServlet.java

@@ -152,7 +152,7 @@ public abstract class RestServlet extends HttpServlet
 
         outputRestResultBean( restResultBean, req, resp );
         final boolean success = restResultBean != null && !restResultBean.isError();
-        LOGGER.trace( sessionLabel, () -> "completed rest invocation, success=" + success, () -> TimeDuration.fromCurrent( startTime ) );
+        LOGGER.trace( sessionLabel, () -> "completed rest invocation, success=" + success, TimeDuration.fromCurrent( startTime ) );
     }
 
    private RestResultBean executeRequest(

+ 1 - 1
server/src/main/java/password/pwm/ws/server/rest/RestStatusServer.java

@@ -102,7 +102,7 @@ public class RestStatusServer extends RestServlet
 
             final RestResultBean restResultBean = RestResultBean.withData( publicUserInfoBean, PublicUserInfoBean.class );
             LOGGER.debug( restRequest.getSessionLabel(), () -> "completed REST status request, result="
-                    + JsonFactory.get().serialize( restResultBean ), () -> TimeDuration.fromCurrent( startTime ) );
+                    + JsonFactory.get().serialize( restResultBean ), TimeDuration.fromCurrent( startTime ) );
             return restResultBean;
         }
         catch ( final PwmException e )