PHP code example of aatis / logger
1. Go to this page and download the library: Download aatis/logger library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
aatis / logger example snippets
$var = 'set';
$logger->log(LogLevel::INFO, 'Logger is {example} !', ['example' => $var]);
// Output : [14-01-2024 22:06:12] INFO Logger is set !
$logger->info('Info message'); // Output : [14-01-2024 22:06:12] INFO Info message
$logger->notice('Notice message'); // Output : [14-01-2024 22:06:12] NOTICE Notice message
$logger->warning('Warning message'); // Output : [14-01-2024 22:06:12] WARNING Warning message
$logger->error('Error message'); // Output : [14-01-2024 22:06:12] ERROR Error message
$logger->critical('Critical message'); // Output : [14-01-2024 22:06:12] CRITICAL Critical message
$logger->alert('Alert message'); // Output : [14-01-2024 22:06:12] ALERT Alert message
$logger->emergency('Emergency message'); // Output : [14-01-2024 22:06:12] EMERGENCY Emergency message
$logger->debug('Debug message'); // Output : [14-01-2024 22:06:12] DEBUG Debug message