Get log
Retrieves connection log data (when in-memory logging is enabled)
- Parameters
- Advanced call ?
Function GetLog(Val Connection, Val AsString = False, Val EventCount = 100) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Connection | - | Arbitrary | ✔ | AddIn object with open connection |
| AsString | - | Boolean | ✖ | True > returns log as a single string, False > as an array |
| EventCount | - | Number | ✖ | Number of recent events to retrieve. 0 > no limits |
Returns
String, Map Of KeyAndValue - Log as a string or a map with the full execution result
This method has no additional advanced call parameters.
Caution
NOCLI: this method is not available in CLI version
1C:Enterprise/OneScript code example
LogFile = GetTempFileName("txt");
LoggingSettings = OPI_RCON.GetLoggingSettings(True, 100, LogFile);
URL = "127.0.0.1:25565";
Password = "12We...";
WriteTimeout = 20;
ReadTimeout = 20;
ConnectionParams = OPI_RCON.FormConnectionParameters(URL, Password, ReadTimeout, WriteTimeout);
Connection = OPI_RCON.CreateConnection(ConnectionParams, LoggingSettings);
If Not OPI_RCON.IsConnector(Connection) Then
Raise OPI_Tools.JSONString(Connection);
EndIf;
Command = "list";
Result = OPI_RCON.ExecuteCommand(Command, Connection);
Result = OPI_RCON.GetLog(Connection);
Result
{
"logs": [
"[2026-05-26 13:58:23.647] Connecting to RCON server 127.0.0.1:25575",
"[2026-05-26 13:58:23.658] Connected to RCON server"
],
"result": true,
"returned": 2,
"total": 2
}