<?php require '../vendor/autoload.php'; use Logger\Logger; use Logger\LogLevel; $log = new Logger(include '../src/Logger/config.php'); $log->log(LogLevel::ALERT, 'Testing logs:' . (isset($_GET['msg']) ? $_GET['msg'] : '')); $log->debug('Testing logs'); $log->warning('WARNING Message '); $log->error('Error Message ');
<?php require '../vendor/autoload.php'; use Logger\Logger; use Logger\LogLevel; $logger = new Logger(include '../src/Logger/config.php'); $logger->log(LogLevel::ALERT, 'Testing logs:' . (isset($_GET['msg']) ? $_GET['msg'] : '')); $logger->warning('WARNING Message '); $logger->error('Error Message '); $messageToLog = "User {username} has logged in"; $messageToLog = $logger->interpolate($messageToLog, ['username' => 'administrator']); $logger->debug($messageToLog);