|
30 | 30 | $defaultLogger = $loggerRegistry->getLogger('console');
|
31 | 31 |
|
32 | 32 | $defaultLogger->debug('User email is john.doe@example.com');
|
33 |
| -// $defaultLogger->info('User IP is 192.168.1.1'); |
34 |
| -// $defaultLogger->notice('User credit card number is 1234-5678-1234-5678', ['context' => 'credit card']); |
35 |
| -// $defaultLogger->warning('User phone number is (11) 91234-7890', ['context' => 'phone']); |
36 |
| -// $defaultLogger->error('This is an error message with email john.doe@example.com', ['context' => 'error']); |
37 |
| -// $defaultLogger->critical('This is a critical message with IP 192.168.1.1', ['context' => 'critical']); |
38 |
| -// $defaultLogger->alert('This is an alert message with credit card 1234-5678-1234-5678', ['context' => 'alert']); |
39 |
| -// $defaultLogger->emergency('This is an emergency message with phone number 123-456-7890', ['context' => 'emergency']); |
| 33 | +$defaultLogger->info('User IP is 192.168.1.1'); |
| 34 | +$defaultLogger->notice('User credit card number is 1234-5678-1234-5678', ['context' => 'credit card']); |
| 35 | +$defaultLogger->warning('User phone number is (11) 91234-7890', ['context' => 'phone']); |
| 36 | +$defaultLogger->error('This is an error message with email john.doe@example.com', ['context' => 'error']); |
| 37 | +$defaultLogger->critical('This is a critical message with IP 192.168.1.1', ['context' => 'critical']); |
| 38 | +$defaultLogger->alert('This is an alert message with credit card 1234-5678-1234-5678', ['context' => 'alert']); |
| 39 | +$defaultLogger->emergency('This is an emergency message with phone number 123-456-7890', ['context' => 'emergency']); |
40 | 40 |
|
41 |
| -// $asyncLogger = $loggerRegistry->getLogger('async'); |
42 |
| -// if ($asyncLogger) { |
43 |
| -// for ($i = 0; $i < 3; ++$i) { |
44 |
| -// $asyncLogger->info("Async log message {$i}", ['context' => "batch {$i}"]); |
45 |
| -// } |
46 |
| -// } |
| 41 | +$asyncLogger = $loggerRegistry->getLogger('async'); |
| 42 | +if ($asyncLogger) { |
| 43 | + for ($i = 0; $i < 3; ++$i) { |
| 44 | + $asyncLogger->info("Async log message {$i}", ['context' => "batch {$i}"]); |
| 45 | + } |
| 46 | +} |
47 | 47 |
|
48 |
| -// $queryLogger = $loggerRegistry->getLogger('query'); |
49 |
| -// $queryLogger->info('Executing a query', ['time' => 90, 'query' => 'SELECT * FROM users', 'bindings' => []]); |
| 48 | +$queryLogger = $loggerRegistry->getLogger('query'); |
| 49 | +$queryLogger->info('Executing a query', ['time' => 90, 'query' => 'SELECT * FROM users', 'bindings' => []]); |
50 | 50 |
|
51 |
| -// $queryLogger = $loggerRegistry->getLogger('query'); |
52 |
| -// $queryLogger->info('Executing a query', ['query' => 'SELECT * FROM users', 'bindings' => []]); |
| 51 | +$queryLogger = $loggerRegistry->getLogger('query'); |
| 52 | +$queryLogger->info('Executing a query', ['query' => 'SELECT * FROM users', 'bindings' => []]); |
53 | 53 |
|
54 |
| -// $performanceLogger = $loggerRegistry->getLogger('performance'); |
55 |
| -// $performanceLogger->debug('Performance logging', ['execution_time' => 1000, 'additional_context' => 'example']); |
| 54 | +$performanceLogger = $loggerRegistry->getLogger('performance'); |
| 55 | +$performanceLogger->debug('Performance logging', ['execution_time' => 1000, 'additional_context' => 'example']); |
56 | 56 |
|
57 |
| -// $performanceLogger = $loggerRegistry->getLogger('performance'); |
58 |
| -// $performanceLogger->debug('Performance logging'); |
| 57 | +$performanceLogger = $loggerRegistry->getLogger('performance'); |
| 58 | +$performanceLogger->debug('Performance logging'); |
59 | 59 |
|
60 |
| -// $errorLogger = $loggerRegistry->getLogger('error'); |
61 |
| -// $errorLogger->error('This is a critical error.', ['context' => 'Testing error logger']); |
| 60 | +$errorLogger = $loggerRegistry->getLogger('error'); |
| 61 | +$errorLogger->error('This is a critical error.', ['context' => 'Testing error logger']); |
62 | 62 |
|
63 |
| -// $slackLogger = $loggerRegistry->getLogger('slack'); |
64 |
| -// $slackLogger->critical('Este é um teste de mensagem crítica enviada para o Slack'); |
| 63 | +$slackLogger = $loggerRegistry->getLogger('slack'); |
| 64 | +$slackLogger->critical('Este é um teste de mensagem crítica enviada para o Slack'); |
0 commit comments