Skip to content

Commit 7ed597b

Browse files
committed
Add check for logging being enabled but log file not existing yet
1 parent 6824954 commit 7ed597b

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## v0.3.1.18
44

5-
-
5+
- Add check for logging being enabled but log file not existing yet
66

77
## v0.3.1.17
88

userfrosting/models/database/SiteSettings.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,9 @@ static public function getLog($targetLines = null, $seekLen = 4096){
407407
if (!ini_get("log_errors")){
408408
$path = ini_get('error_log');
409409
$messages = ["Error logging appears to be disabled. Please check your php.ini file."];
410+
} else if (!file_exists(ini_get('error_log'))){
411+
$path = ini_get('error_log');
412+
$messages = ["Log file not found. If you haven't generated any errors, this is fine. If you were expecting to see errors here, please check your php.ini file."];
410413
} else {
411414
$path = ini_get('error_log');
412415
@$file = file($path);

0 commit comments

Comments
 (0)