-
Notifications
You must be signed in to change notification settings - Fork 2
Log
Viames Marino edited this page Feb 23, 2026
·
1 revision
Pair\Helpers\Log is the central static logging helper used across Pair.
Use Log when you need framework-level logs from controllers, models, services, jobs, or integrations.
Common levels are exposed as static methods in the helper (for example debug, info, warning, error) and accept a message plus optional context.
\Pair\Helpers\Log::info('Order imported', ['orderId' => 2241]);
\Pair\Helpers\Log::warning('Gateway latency high', ['provider' => 'stripe']);final class BillingSyncService {
public function run(int $invoiceId): void
{
\Pair\Helpers\Log::debug('Billing sync started', ['invoiceId' => $invoiceId]);
try {
// sync logic
\Pair\Helpers\Log::info('Billing sync completed', ['invoiceId' => $invoiceId]);
} catch (\Throwable $e) {
\Pair\Helpers\Log::error('Billing sync failed', [
'invoiceId' => $invoiceId,
'exception' => $e->getMessage()
]);
throw $e;
}
}
}- Logging only plain strings without context makes diagnostics harder.
- Logging sensitive data (tokens, passwords, full card data) must be avoided.