Skip to content

Commit

Permalink
Clean up session logs in the same way as we used to
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Jun 23, 2017
1 parent 2d69139 commit 4e477eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@

package org.openqa.selenium.remote.server;

import static java.util.concurrent.TimeUnit.MINUTES;

import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.RemovalListener;

import org.openqa.selenium.remote.SessionId;
import org.openqa.selenium.remote.server.log.LoggingManager;
import org.openqa.selenium.remote.server.log.PerSessionLogHandler;

import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
Expand All @@ -42,6 +42,10 @@ public ActiveSessions(long inactiveSessionTimeout, TimeUnit unit) {
log("Removing session %s: %s", notification.getKey(), notification.getCause());
ActiveSession session = notification.getValue();
session.stop();

PerSessionLogHandler logHandler = LoggingManager.perSessionLogHandler();
logHandler.transferThreadTempLogsToSessionLogs(session.getId());
logHandler.removeSessionLogs(session.getId());
};

allSessions = CacheBuilder.newBuilder()
Expand Down
1 change: 1 addition & 0 deletions java/server/src/org/openqa/selenium/remote/server/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ java_library(
':server',
':sessions',
'//java/client/src/org/openqa/selenium/remote:remote',
'//java/server/src/org/openqa/selenium/remote/server/log:log',
'//third_party/java/gson:gson',
'//third_party/java/guava:guava',
],
Expand Down

0 comments on commit 4e477eb

Please sign in to comment.