Class LogServerCLI
java.lang.Object
com.scivicslab.actoriac.cli.LogServerCLI
CLI subcommand to start an H2 TCP server for centralized workflow logging.
This enables multiple actor-IaC processes on the same machine to write to a single shared log database. The server runs on localhost only - remote connections are not needed because actor-IaC operates from a single operation terminal.
Architecture:
[Operation Terminal]
├── H2 Log Server (localhost:29090)
├── Workflow Process A ──→ TCP write
├── Workflow Process B ──→ TCP write
└── Workflow Process C ──→ TCP write
│
│ SSH commands
▼
[Remote Nodes] ← Don't write directly to log server
Usage:
# Start the log server
actor-iac log-server --db ./logs/actor-iac-logs
# In another terminal, run workflow with --log-server
actor-iac -d ./workflows -w deploy --log-server=localhost:29090
- Author:
- devteam@scivics-lab.com
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classInformation about a service running on a port. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Fileprivate booleanprivate static final Loggerprivate intprivate static final int[]Ports to scan for H2 servers (actor-IaC reserved range: 29090-29100)private final CountDownLatchprivate org.h2.tools.Serverprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall()private LogServerCLI.ServerInfocheckPort(int checkPort) Checks what's running on a port.private intFinds an available port.private IntegerFinds running H2 log servers on localhost.private StringidentifyService(int checkPort) Identifies a service using lsof.private voidprivate voidprivate voidshutdown()private voidTries to get information about a log server's database.
-
Field Details
-
LOG
-
port
-
dbPath
-
verbose
-
find
-
tcpServer
-
SCAN_PORTS
Ports to scan for H2 servers (actor-IaC reserved range: 29090-29100) -
shutdownLatch
-
-
Constructor Details
-
LogServerCLI
public LogServerCLI()
-
-
Method Details
-
call
-
initializeDatabase
- Throws:
SQLException
-
printConnectionInfo
-
shutdown
-
findLogServers
Finds running H2 log servers on localhost.- Returns:
- exit code (0 = success)
-
checkPort
Checks what's running on a port. -
tryGetLogServerInfo
Tries to get information about a log server's database. -
identifyService
Identifies a service using lsof. -
findAvailablePort
Finds an available port.
-