diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/DefaultStrolchSessionHandler.java b/li.strolch.rest/src/main/java/li/strolch/rest/DefaultStrolchSessionHandler.java index 0944dc19f..25eb355c8 100644 --- a/li.strolch.rest/src/main/java/li/strolch/rest/DefaultStrolchSessionHandler.java +++ b/li.strolch.rest/src/main/java/li/strolch/rest/DefaultStrolchSessionHandler.java @@ -65,7 +65,7 @@ public class DefaultStrolchSessionHandler extends StrolchComponent implements St this.privilegeHandler = getContainer().getComponent(PrivilegeHandler.class); this.certificateMap = new HashMap<>(); - this.sessionTimeoutTimer = new Timer("SessionTimeoutTimer"); + this.sessionTimeoutTimer = new Timer("SessionTimeoutTimer"); //$NON-NLS-1$ long checkInterval = TimeUnit.MINUTES.toMillis(1); this.sessionTimeoutTimer.schedule(new SessionTimeoutTask(), checkInterval, checkInterval); @@ -109,7 +109,7 @@ public class DefaultStrolchSessionHandler extends StrolchComponent implements St certificate.setLastAccess(System.currentTimeMillis()); this.certificateMap.put(certificate.getAuthToken(), certificate); - logger.info(this.certificateMap.size() + " sessions currently active."); + logger.info(MessageFormat.format("{0} sessions currently active.", this.certificateMap.size())); //$NON-NLS-1$ return certificate; } } @@ -174,11 +174,11 @@ public class DefaultStrolchSessionHandler extends StrolchComponent implements St certificateMap = new HashMap<>(map); } - long reqLastAccessTime = System.currentTimeMillis() - sessionTtl; + long reqLastAccessTime = System.currentTimeMillis() - DefaultStrolchSessionHandler.this.sessionTtl; for (Certificate certificate : certificateMap.values()) { if (certificate.getLastAccess() < reqLastAccessTime) { - String msg = "Session {0} for user {1} has expired, invalidating session..."; + String msg = "Session {0} for user {1} has expired, invalidating session..."; //$NON-NLS-1$ logger.info(MessageFormat.format(msg, certificate.getAuthToken(), certificate.getUsername())); invalidateSession(certificate); } diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/RestfulStrolchComponent.java b/li.strolch.rest/src/main/java/li/strolch/rest/RestfulStrolchComponent.java index e8e9f4910..f92d00e5c 100644 --- a/li.strolch.rest/src/main/java/li/strolch/rest/RestfulStrolchComponent.java +++ b/li.strolch.rest/src/main/java/li/strolch/rest/RestfulStrolchComponent.java @@ -15,6 +15,8 @@ */ package li.strolch.rest; +import java.text.MessageFormat; + import li.strolch.agent.api.ComponentContainer; import li.strolch.agent.api.StrolchComponent; import li.strolch.rest.filters.AccessControlResponseFilter; @@ -114,6 +116,9 @@ public class RestfulStrolchComponent extends StrolchComponent { this.restTracing = configuration.getString(PARAM_REST_TRACING, "OFF"); //$NON-NLS-1$ this.restTracingThreshold = configuration.getString(PARAM_REST_TRACING_THRESHOLD, "SUMMARY"); //$NON-NLS-1$ + String msg = "Set restTracing={0} with threshold={1}"; //$NON-NLS-1$ + logger.info(MessageFormat.format(msg, this.restTracing, this.restTracingThreshold)); + super.initialize(configuration); }