1. Go to this page and download the library: Download idearia/php-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/ */
idearia / php-logger example snippets
Logger::$log_level = 'debug';
Logger::debug( "variable x is false" );
Logger::info( "program started" );
Logger::warning( "variable not set, something bad might happen" );
Logger::error( "file not found, exiting" );
Logger::$log_level = 'error'; // Show only errors
Logger::$log_level = 'warning'; // Show warnings and errors
Logger::$log_level = 'info'; // Show info messages, warnings and errors
Logger::$log_level = 'debug'; // Show debug messages, info messages, warnings and errors
$> 2021-07-21T11:11:03+02:00 [DEBUG] : variable x is false
$> 2021-07-21T11:11:03+02:00 [INFO] : program started
$> 2021-07-21T11:11:03+02:00 [WARNING] : variable not set, something bad might happen
$> 2021-07-21T11:11:03+02:00 [ERROR] : file not found, exiting
$> 2022-04-19T17:26:26+00:00 [DEBUG] : Elapsed time => 1.003163 seconds
$> 2022-04-19T17:32:15+00:00 [DEBUG] : Elapsed time for 'inner timer' => 1.002268 seconds
$> 2022-04-19T17:32:15+00:00 [DEBUG] : Elapsed time for 'outer timer' => 2.006117 seconds
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.