PHP code example of toshkq93 / custom-logger
1. Go to this page and download the library: Download toshkq93/custom-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/ */
toshkq93 / custom-logger example snippets
$logger_file = Logger::factory(FileDriver::class, ['filePath' => 'data/default.log']);
$logger_db = Logger::factory(DatabaseDriver::class, [
'dsn' => 'mysql:host=127.0.0.1;dbname=test;charset=utf8',
'table' => 'qwerty',
'username' => 'root',
'password' => '',
]);
$logger_db->info('test');
$logger_file->info('text');