Skip to main content

Logbook

Every resource detail page adds a logbook item to the actions dropdown.

The logbook opens a modal with an EloquentTableNode backed by Qore\Next\System\Models\Log:

Log::query()->whereMorphedTo('entity', $model)

Automatic Logs

Qore writes logs for common resource flows:

  • resource create, update and delete mutations;
  • field mutation changes;
  • file attachments and removals;
  • relation attach and detach changes;
  • resource action execution.

Field mutation logging compares the original model value with the new model value and skips the log when nothing changed. Fields marked with setIsSensitive() compare raw stored values and replace configured old and new values with [redacted]. PasswordField enables this automatically.

Manual Logs

Use qore()->logger() when application-specific workflows need to appear in the logbook:

qore()->logger()
->setEntity($product)
->setDescription('price_imported')
->setFieldName('price')
->setOldValue($oldPrice)
->setNewValue($newPrice)
->setPayload(['source' => 'import'])
->save();

The logger service sets the authenticated user ID automatically when a user is logged in.

Log Shape

The default logbook table shows:

  • date;
  • user;
  • description;
  • field;
  • new value;
  • old value.

ID is available in the table settings, but hidden by default. Long or multiline new and old values are shown as compact previews with a separate dialog for inspecting the full content.

payload is available on the model for structured context, but it is not shown as a normal table column by default.

Descriptions

Use short, stable descriptions such as price_imported, approved or the values from ResourceMutationDescription.

Avoid putting long human text in description; put detailed context in payload so the log stays filterable and consistent.