PHP code example of scissorhands / ci-logs

1. Go to this page and download the library: Download scissorhands/ci-logs 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/ */

    

scissorhands / ci-logs example snippets



use cilogs\application\migrations\Create_logs_table as Logs_migration;
defined('BASEPATH') OR exit('No direct script access allowed');

class Migration_Create_logs_table extends Logs_migration {

	public function __construct()
	{
		parent::__construct();
	}
}



use cilogs\application\models\Logger_model as CILogger;
defined('BASEPATH') OR exit('No direct script access allowed');

class Logger_model extends CILogger {
	public function __construct()
	{
		parent::__construct();
	}
}


defined('BASEPATH') OR exit('No direct script access allowed');

class Test extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
		$this->load->model('logger_model', 'logger');
		$this->logger->init('testing', [
			'log_table' => 'app_logs',
			'extra_fields' => ['client_id']
		]);
	}

	public function log2db()
	{
		$this->logger->log('Hello world', [
			'client_id' => 123456,
		], 'info');
	}

}