1. Go to this page and download the library: Download cakephp/log 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/ */
Log::config('special', function () {
// Return any PSR-3 compatible logger
return new MyPSR3CompatibleLogger();
});
Log::config('special', new MyPSR3CompatibleLogger());
Log::write('debug', 'Something did not work');
// Configure /logs/payments.log to receive all levels, but only
// those with `payments` scope.
Log::config('payments', [
'className' => 'FileLog',
'levels' => ['error', 'info', 'warning'],
'scopes' => ['payments'],
'file' => '/logs/payments.log',
]);
Log::warning('this gets written only to payments.log', ['scope' => ['payments']]);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.