public class PerSessionLogHandler
extends java.util.logging.Handler
| Modifier and Type | Class and Description |
|---|---|
protected static class |
PerSessionLogHandler.ThreadKey |
| Constructor and Description |
|---|
PerSessionLogHandler(int capacity,
java.util.logging.Formatter formatter,
boolean captureLogsOnQuit)
New handler keeping track of log records per session.
|
| Modifier and Type | Method and Description |
|---|---|
void |
attachToCurrentThread(org.openqa.selenium.remote.SessionId sessionId) |
void |
clearThreadTempLogs()
Clears the logging events attached to the thread.
|
void |
close() |
void |
configureLogging(org.openqa.selenium.logging.LoggingPreferences prefs)
Configures logging using a logging preferences object.
|
void |
detachFromCurrentThread() |
void |
fetchAndStoreLogsFromDriver(org.openqa.selenium.remote.SessionId sessionId,
org.openqa.selenium.WebDriver driver)
Fetches and stores available logs from the given session and driver.
|
void |
flush() |
org.openqa.selenium.logging.SessionLogs |
getAllLogsForSession(org.openqa.selenium.remote.SessionId sessionId)
Gets all logs for a session.
|
java.lang.String |
getLog(org.openqa.selenium.remote.SessionId sessionId)
This returns Selenium Remote Control logs associated with the sessionId.
|
java.util.List<org.openqa.selenium.remote.SessionId> |
getLoggedSessions()
Returns a list of session IDs for which there are logs.
|
org.openqa.selenium.logging.LogEntries |
getSessionLog(org.openqa.selenium.remote.SessionId sessionId)
Returns the server log for the given session id.
|
void |
publish(java.util.logging.LogRecord record) |
void |
removeSessionLogs(org.openqa.selenium.remote.SessionId sessionId)
Removes session logs for the given session id.
|
void |
transferThreadTempLogsToSessionLogs(org.openqa.selenium.remote.SessionId sessionId) |
public PerSessionLogHandler(int capacity,
java.util.logging.Formatter formatter,
boolean captureLogsOnQuit)
capacity - The capacityformatter - Formatter to use when retrieving log messages.captureLogsOnQuit - Whether to enable log capture on quit.public void attachToCurrentThread(org.openqa.selenium.remote.SessionId sessionId)
public void transferThreadTempLogsToSessionLogs(org.openqa.selenium.remote.SessionId sessionId)
public void detachFromCurrentThread()
public void removeSessionLogs(org.openqa.selenium.remote.SessionId sessionId)
sessionId - The session id to use.public void clearThreadTempLogs()
public java.lang.String getLog(org.openqa.selenium.remote.SessionId sessionId)
throws java.io.IOException
sessionId - session-id for which the RC logs will be returned.java.io.IOException - when the elves go badpublic java.util.List<org.openqa.selenium.remote.SessionId> getLoggedSessions()
public org.openqa.selenium.logging.SessionLogs getAllLogsForSession(org.openqa.selenium.remote.SessionId sessionId)
sessionId - The id of the session.public org.openqa.selenium.logging.LogEntries getSessionLog(org.openqa.selenium.remote.SessionId sessionId)
throws java.io.IOException
sessionId - The session id.java.io.IOException - If there was a problem reading from file.public void fetchAndStoreLogsFromDriver(org.openqa.selenium.remote.SessionId sessionId,
org.openqa.selenium.WebDriver driver)
throws java.io.IOException
sessionId - The id of the session.driver - The driver to get the logs from.java.io.IOException - If there was a problem reading from file.public void configureLogging(org.openqa.selenium.logging.LoggingPreferences prefs)
prefs - The logging preferences object.public void publish(java.util.logging.LogRecord record)
publish in class java.util.logging.Handlerpublic void flush()
flush in class java.util.logging.Handlerpublic void close()
throws java.lang.SecurityException
close in class java.util.logging.Handlerjava.lang.SecurityException