PHP code example of seunmatt / codeigniter-log-viewer
1. Go to this page and download the library: Download seunmatt/codeigniter-log-viewer 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/ */
seunmatt / codeigniter-log-viewer example snippets
namespace App\Controllers;
use CILogViewer\CILogViewer;
class LogViewerController extends BaseController
{
public function index() {
$logViewer = new CILogViewer();
return $logViewer->showLogs();
}
}
namespace Config;
use CodeIgniter\Config\BaseConfig;
class CILogViewer extends BaseConfig {
public $logFilePattern = 'log-*.log';
public $viewName = 'logs'; //where logs exists in app/Views/logs.php
}