1. Go to this page and download the library: Download kynetcode/wpzylos-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/ */
use WPZylos\Framework\Logger\Logger;
$logger = new Logger($context, null, 'warning');
$logger->warning('Low disk space');
$logger->emergency('System is unusable');
$logger->alert('Action must be taken immediately');
$logger->critical('Critical conditions');
$logger->error('Error conditions');
$logger->warning('Warning conditions');
$logger->notice('Normal but significant condition');
$logger->info('Informational messages');
$logger->debug('Debug-level messages');
// Logs written to: wp-content/uploads/{slug}/logs/2025-01-15.log
$logger->info('Application started');
// Clean old logs (30 days default)
$deleted = $logger->cleanOldLogs(30);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.