Class LogsCLI
java.lang.Object
com.scivicslab.actoriac.cli.LogsCLI
CLI tool for querying workflow execution logs from H2 database.
Usage examples:
# Show summary of the latest session java -jar actor-IaC.jar logs --db logs --summary # Show logs for a specific node java -jar actor-IaC.jar logs --db logs --node node-001 # Show only error logs java -jar actor-IaC.jar logs --db logs --level ERROR # List all sessions java -jar actor-IaC.jar logs --db logs --list
- Author:
- devteam@scivics-lab.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Fileprivate Stringprivate Stringprivate static final DateTimeFormatterISO 8601 format with timezone offset (e.g., 2026-01-05T10:30:00+09:00).private intprivate booleanprivate booleanprivate LogLevelprivate Stringprivate Stringprivate Stringprivate Longprivate Stringprivate Stringprivate booleanprivate static final ZoneIdSystem timezone for display.private String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall()private H2LogReaderCreates an H2LogReader, using TCP connection if --server is specified.private StringformatTimestamp(LocalDateTime timestamp) Formats a LocalDateTime as ISO 8601 string with timezone offset.private StringgetLevelPrefix(LogLevel level) private IntegerlistNodesInSession(H2LogReader reader, long targetSession) private IntegerlistRecentSessions(H2LogReader reader) static voidMain entry point for the logs CLI.private LocalDateTimeparseSince(String sinceStr) Parses a relative time string into a LocalDateTime.private IntegershowLogs(H2LogReader reader, long targetSession) private IntegershowSummary(H2LogReader reader, long targetSession)
-
Field Details
-
ISO_FORMATTER
ISO 8601 format with timezone offset (e.g., 2026-01-05T10:30:00+09:00). -
SYSTEM_ZONE
System timezone for display. -
dbPath
-
server
-
sessionId
-
nodeId
-
minLevel
-
summaryOnly
-
listSessions
-
workflowFilter
-
overlayFilter
-
inventoryFilter
-
startedAfter
-
since
-
endedSince
-
limit
-
listNodes
-
-
Constructor Details
-
LogsCLI
public LogsCLI()
-
-
Method Details
-
main
-
call
-
createReader
Creates an H2LogReader, using TCP connection if --server is specified.- Returns:
- H2LogReader instance
- Throws:
SQLException- if connection fails
-
listRecentSessions
-
listNodesInSession
-
showSummary
-
showLogs
-
getLevelPrefix
-
formatTimestamp
Formats a LocalDateTime as ISO 8601 string with timezone offset.Example output: 2026-01-05T10:30:00+09:00
- Parameters:
timestamp- the timestamp to format- Returns:
- ISO 8601 formatted string, or "N/A" if null
-
parseSince
Parses a relative time string into a LocalDateTime.Supported formats:
12h- 12 hours ago1d- 1 day ago3d- 3 days ago1w- 1 week ago
- Parameters:
sinceStr- the relative time string- Returns:
- LocalDateTime representing the calculated time, or null if invalid format
-