Get log
Retrieves log data (with logging to memory enabled)
- Parameters
- Advanced call ?
Function GetLog(Val AddInObject, Val AsString = False, Val EventCount = 100) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| AddInObject | - | Arbitrary | ✔ | VM AddIn object |
| 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_Lua.GetLoggingSettings(True, 100, LogFile);
Lua = OPI_Lua.CreateVM("Lua54", LoggingSettings);
OPI_Lua.ExecuteCodeFromString(Lua, "return 1");
Result = OPI_Lua.GetLog(Lua);
Result
{
"logs": [
"[2026-06-18 17:39:26.974] Logger initialized",
"[2026-06-18 17:39:26.974] ExecuteString called"
],
"result": true,
"returned": 2,
"total": 2
}