<?php
// ver_log.php - Ver log de erros
echo "<h1>📋 Log de Erros do PHP</h1>";

$logFile = ini_get('error_log');
echo "<p>Arquivo de log: " . ($logFile ?: 'Não definido') . "</p>";

// Tentar ler error_log na raiz
$paths = [
    __DIR__ . '/error_log',
    __DIR__ . '/../error_log',
    '/home/vartenet/public_html/mkt/error_log',
    '/home/vartenet/public_html/error_log',
];

foreach ($paths as $path) {
    if (file_exists($path)) {
        echo "<h3>📄 " . basename(dirname($path)) . "/" . basename($path) . "</h3>";
        echo "<pre style='background:#121a2e;padding:10px;border-radius:5px;max-height:400px;overflow:auto;font-size:11px;'>";
        $lines = file($path);
        $last = array_slice($lines, -50); // Últimas 50 linhas
        foreach ($last as $line) {
            echo htmlspecialchars($line);
        }
        echo "</pre>";
    }
}