small loggin fixes

This commit is contained in:
1Day 2022-02-15 16:05:46 +01:00
parent 49256a3522
commit d6935482e6
3 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View file

@ -24,3 +24,4 @@ storage/app/public/logo.png
- Kopie.env - Kopie.env
public/install/logs.txt public/install/logs.txt
install.lock install.lock
public/install/logs/installer.log

View file

@ -84,7 +84,7 @@ if (isset($_POST['feedDB'])) {
if (strpos(getEnvironmentValue("APP_KEY"), 'base64') !== false) { if (strpos(getEnvironmentValue("APP_KEY"), 'base64') !== false) {
header("LOCATION: index.php?step=3"); header("LOCATION: index.php?step=3");
} else { } else {
header("LOCATION: index.php?step=2.5&message=There was an error. Please check the .txt file in install/log !"); header("LOCATION: index.php?step=2.5&message=There was an error. Please check the .txt file in /var/www/controlpanel/public/install/logs !");
} }

View file

@ -130,12 +130,12 @@ function run_console($command)
function wh_log($log_msg) function wh_log($log_msg)
{ {
$log_filename = "log"; $log_filename = "logs";
if (!file_exists($log_filename)) { if (!file_exists($log_filename)) {
// create directory/folder uploads. // create directory/folder uploads.
mkdir($log_filename, 0777, true); mkdir($log_filename, 0777, true);
} }
$log_file_data = $log_filename . '/log_' . date('d-M-Y') . '.log'; $log_file_data = $log_filename . '/installer.log';
// if you don't add `FILE_APPEND`, the file will be erased each time you add a log // if you don't add `FILE_APPEND`, the file will be erased each time you add a log
file_put_contents($log_file_data, "[" . date('h:i:s') . "] " . $log_msg . "\n", FILE_APPEND); file_put_contents($log_file_data, "[" . date('h:i:s') . "] " . $log_msg . "\n", FILE_APPEND);
} }