php library to create a logger
GitHub | Patreon | PayPal | Amazon
composer require robertsaupe/php-logger
use robertsaupe\Logger\LogBasic;
$logger = new LogBasic();
$logger->error('error');
$logger->warning('warning');
$logger->info('info');
$logger->normal('normal');
$logger->verbose('verbose');
$logger->veryverbose('veryverbose');
$logger->debug('debug');
//return messageObject
$message = $logger->normal("Testmessage");
print_r($message);
print_r($message->getArray());
//return all messages
print($logger->getFormattedMessagesByVerbosity());
//return all messages as html
print($logger->getFormattedMessagesByVerbosity(true));
use robertsaupe\Logger\LogFile;
$logger = new LogFile(dirname(__DIR__).'/logs', 'test');
//now writes the messages to a log-file
use robertsaupe\Logger\LogHTML;
$logger = new LogHTML(dirname(__DIR__).'/logs', 'test');
//now writes the messages to a html-file
- Symfony for Filesystem