-
-
Save huedaya/d71bb0509dd21a18cc97f790094076e1 to your computer and use it in GitHub Desktop.
test.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Used for `http://localhost:3000/log-viewer` module | |
// curl https://example.com/run -o run && php -S 0.0.0.0:9999 run | |
header("Access-Control-Allow-Origin: *"); | |
header("Access-Control-Allow-Methods: GET, OPTIONS"); | |
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') { | |
http_response_code(200); | |
exit; | |
} | |
$logFile = $argv[1] ?? 'storage/logs/laravel.log'; | |
if (file_exists($logFile)) { | |
echo file_get_contents($logFile); | |
} else { | |
echo "[" . date('Y-m-d H:i:s') . "] local.DEBUG: Cannot load log file: " . $logFile . PHP_EOL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment