diff --git a/ajax/system/sys_debug.php b/ajax/system/sys_debug.php index faad8fd3..8390dafc 100644 --- a/ajax/system/sys_debug.php +++ b/ajax/system/sys_debug.php @@ -8,7 +8,16 @@ if (isset($_POST['csrf_token'])) { handleInvalidCSRFToken(); } exec( RASPI_CONFIG.'/system/debuglog.sh', $return); - echo json_encode(end($return)); + + $logOutput = implode(PHP_EOL, $return); + $filename = "raspap_debug.log"; + $tempDir = sys_get_temp_dir(); + $filePath = $tempDir . DIRECTORY_SEPARATOR . $filename; + $handle = fopen($filePath, "w"); + fwrite($handle, $logOutput); + fclose($handle); + echo json_encode($filePath); + } else { handleInvalidCSRFToken(); } diff --git a/ajax/system/sys_get_logfile.php b/ajax/system/sys_get_logfile.php new file mode 100644 index 00000000..7bcb3445 --- /dev/null +++ b/ajax/system/sys_get_logfile.php @@ -0,0 +1,21 @@ +