PHP code example of apollo11 / file-logger
1. Go to this page and download the library: Download apollo11/file-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/ */
apollo11 / file-logger example snippets
$logger = new \apollo11\fileLogger\FileLogger([
'logFilePath' => dirname(__FILE__) . '/logs',
'logFileName' => 'test12.log',
'logFileDateFormat' => "Y_m_d_H_i_s",
'logFileTemplate' => '{date}_{fileName}',
'logTextDateFormat' => 'Y-m-d',
'logTextTemplate' => '{date} [{type}] - {message}' . PHP_EOL,
]);
for ($i = 0; $i < 20; $i++){
$logger->log("My test $i", \apollo11\fileLogger\FileColor::F_WHITE, \apollo11\fileLogger\FileColor::B_GREEN);
}
php composer.phar