setFormatter($consoleFormatter); $log->pushHandler($consoleHandler); // Set up the file handler $fileHandler = new RotatingFileHandler($logFilePath, 0, Logger::DEBUG); $fileFormatter = new LineFormatter( "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n", "Y-m-d H:i:s.u" // Date format ); $fileHandler->setFormatter($fileFormatter); $log->pushHandler($fileHandler); return $log; } function fetchCount($pdo, $tableName) { $stmt = $pdo->prepare("SELECT count(id) AS count FROM {$tableName};"); $stmt->execute(); $result = $stmt->fetch(); return $result['count']; }