Skip to content

ErrorLog

Viames Marino edited this page Feb 23, 2026 · 1 revision

Pair framework: ErrorLog

Pair\Models\ErrorLog stores application errors with normalized metadata.

Main methods

  • getLevelDescription(): string

Lifecycle hooks:

  • _init() model definition
  • afterPopulate() post-hydration normalization
  • beforePrepareData() pre-serialization shaping

Implementation example

$error = new \Pair\Models\ErrorLog();
$error->level = 3;
$error->message = 'Payment provider timeout';
$error->context = json_encode(['orderId' => 119]);
$error->store();

echo $error->getLevelDescription();

Notes

  • Useful for backend diagnostics and operational dashboards.

See also: Log, LogBar, Audit.

Clone this wiki locally