Manages debug sessions for the current tenant: short-lived captures of web requests, async tasks and their operation logs, used to diagnose problems in a running Kademi tenant. Registered against the tenant's root context and reached with C(DebugManager.class), this is the entry point for creating a debug session builder, activating and ending sessions, and querying the operations and logs captured by a session. Each tenant is limited to 3 concurrently active sessions. The actual session state and captured data are held by the injected DebugService.
Group: Managers
Properties
| Property | Returns | Description |
|---|---|---|
| maxDebugSessionFileSize | long | The maximum combined size, in bytes, that a single debug session's captured logs are allowed to reach before it is stopped, as configured in the server's system parameters. |
| maxDebugSessionOperations | int | The maximum number of operations a single debug session is allowed to capture before it stops recording new ones, as configured in the server's system parameters. |
Methods
newDebugSessionBuilder() · addSession(DebugSessionBuilder b) · endSession(String sessionId) · clearSession(String sessionId) · deleteSession(String sessionId) · findClosedSession(String sessionId) · findActiveSessions() · findSessions() · findSessions(Date startDate, Date endDate) · findActiveSession(String sessId) · findOperationsForSession(String sessionId) · findOperationDetails(String sessionId, String opId) · numOperationsForSession(String sessionId) · readOperationLogs(String sessionId, String opId, int fromLine, int maxLines) · getMaxDebugSessionOperations() · getMaxDebugSessionFileSize()
newDebugSessionBuilder()
Returns: DebugSessionBuilder
Creates a builder for configuring a new debug session for the current tenant and the currently logged in user. The session is not started until the builder's result is passed to addSession.
addSession(DebugSessionBuilder b)
Returns: DebugSession
Starts a new debug session for the current tenant, built with newDebugSessionBuilder.
| Parameter | Description |
|---|---|
b | the configured session builder |
endSession(String sessionId)
Returns: void
Ends an active debug session, stopping further capture of requests and operations.
| Parameter | Description |
|---|---|
sessionId | the id of the session to end |
clearSession(String sessionId)
Returns: void
Clears the operations and logs captured so far by a debug session for the current tenant, without ending the session itself.
| Parameter | Description |
|---|---|
sessionId | the id of the session to clear |
deleteSession(String sessionId)
Returns: void
Permanently deletes a debug session for the current tenant, including its captured operations and logs.
| Parameter | Description |
|---|---|
sessionId | the id of the session to delete |
findClosedSession(String sessionId)
Returns: DebugSession
Looks up a debug session that has already ended, for the current tenant.
| Parameter | Description |
|---|---|
sessionId | the id of the closed session |
findActiveSessions()
Returns: List<DebugSession>
Looks up the currently active debug sessions for the current tenant.
findSessions()
Returns: List<DebugSessionInfo>
Looks up summary information for all debug sessions, active and closed, for the current tenant.
findSessions(Date startDate, Date endDate)
Returns: List<DebugSessionInfo>
Looks up summary information for the current tenant's debug sessions created within a date range.
| Parameter | Description |
|---|---|
startDate | the earliest session creation date to include |
endDate | the latest session creation date to include |
findActiveSession(String sessId)
Returns: DebugSession
Looks up a single active debug session for the current tenant by its id.
| Parameter | Description |
|---|---|
sessId | the id of the active session |
findOperationsForSession(String sessionId)
Returns: List<OperationInfo>
Looks up the operations captured by a debug session for the current tenant, most recently started first.
| Parameter | Description |
|---|---|
sessionId | the id of the session to query |
findOperationDetails(String sessionId, String opId)
Returns: OperationDetails
Looks up the full details of a single operation captured by a debug session for the current tenant.
| Parameter | Description |
|---|---|
sessionId | the id of the session the operation was captured in |
opId | the id of the operation to look up |
numOperationsForSession(String sessionId)
Returns: int
Counts the operations captured by a debug session for the current tenant.
| Parameter | Description |
|---|---|
sessionId | the id of the session to count operations for |
readOperationLogs(String sessionId, String opId, int fromLine, int maxLines)
Returns: List<String>
Reads a page of log lines captured for a single operation within a debug session for the current tenant.
| Parameter | Description |
|---|---|
sessionId | the id of the session the operation was captured in |
opId | the id of the operation to read logs for |
fromLine | the zero-based index of the first log line to return |
maxLines | the maximum number of log lines to return |
getMaxDebugSessionOperations()
Returns: int
The maximum number of operations a single debug session is allowed to capture before it stops recording new ones, as configured in the server's system parameters.
getMaxDebugSessionFileSize()
Returns: long
The maximum combined size, in bytes, that a single debug session's captured logs are allowed to reach before it is stopped, as configured in the server's system parameters.