File manager - Edit - /var/www/html/homologBancodetalentos/app/Support/TalentBank/IntegrationLog.php
Back
<?php namespace App\Support\TalentBank; use Illuminate\Support\Facades\Log; /** * Logs estruturados para integrações (AUTH / Angra / BT), com correlation_id quando disponível. */ final class IntegrationLog { /** * @return array<string, string|null> */ public static function baseContext(): array { $cid = null; if (function_exists('request') && request()) { $v = request()->attributes->get('correlation_id'); $cid = is_string($v) && $v !== '' ? $v : null; } return array_filter([ 'correlation_id' => $cid, ], static fn ($v) => $v !== null && $v !== ''); } /** * @param array<string, mixed> $context */ public static function info(string $integration, string $operation, array $context = []): void { Log::info($integration.'.'.$operation, array_merge(self::baseContext(), $context)); } /** * @param array<string, mixed> $context */ public static function warning(string $integration, string $operation, array $context = []): void { Log::warning($integration.'.'.$operation, array_merge(self::baseContext(), $context)); } /** * @param array<string, mixed> $context */ public static function error(string $integration, string $operation, array $context = []): void { Log::error($integration.'.'.$operation, array_merge(self::baseContext(), $context)); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings