Skip to content

Log Repository

Read API log entries for debugging and auditing.

Usage

php
use Innobrain\OnOfficeAdapter\Facades\LogRepository;

$logs = LogRepository::query()->get();
$log = LogRepository::query()->limit(1)->first();

$logs = LogRepository::query()
    ->withModule('estate')
    ->withAction('create')
    ->withUserId(5)
    ->get();

$count = LogRepository::query()->withModule('estate')->limit(0)->count();

LogRepository::query()->each(fn ($logs) => /* process */);

WARNING

Log reads require an admin API user — anyone else gets an access violation (error 156).

The API requires a listlimit between 0 and 500, and cntabsolute echoes the number of returned rows instead of reporting a true total. get() and each() set the limit automatically; first() needs an explicit limit(1). count() only returns the real total with limit(0) — any other limit makes it return that limit. find($id) sends no listlimit and is rejected by the API — filter with get() instead.

Response

Each record has the shape {id, type, elements}:

FieldDescription
idLog entry ID
typeAlways Log
elements.moduleModule name
elements.actionAction performed
elements.userIdUser ID, or null
elements.dateTimeWhen the action occurred
elements.resourceIdID of the affected record
elements.resourceTable / elements.resourcePkAffected table and primary key

Released under the MIT License.