Repository navigation
Log
Viames Marino edited this page May 5, 2026
·
2 revisions
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.
- Warning and error records are persisted as structured
LogEventrows with sanitized context and trace metadata.
See also: Logger, LogTrait, LogBar, LogEvent, ErrorLog, DatabaseLogWriter.
Maintained by Viames Marino — VM Ingegneria · Professional enquiries
Home · Setup · Configuration
Build with Pair 4
- Generator
- Controllers and responses
- Read models
- ActiveRecord and queries
- Forms and validation
- PairUI.js and HTML fragments
APIs and authentication
- API guide and CRUD
- Middleware and rate limits
- Users, sessions, and ACL
- Passkeys and social login
- Native mobile setup
Integrate and operate
- Integrations
- Runtime extensions and adapter keys
- Cache and cache stores
- Logs and observability
- PWA and push
- Packages and distribution
- Upgrade to v4