mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Print a useful error if logfile is not writable (#15233)
This commit is contained in:
@@ -108,7 +108,15 @@ function parse_modules($type, $options)
|
||||
|
||||
function logfile($string)
|
||||
{
|
||||
$fd = fopen(Config::get('log_file'), 'a');
|
||||
$file = Config::get('log_file');
|
||||
$fd = fopen($file, 'a');
|
||||
|
||||
if ($fd === false) {
|
||||
print_error("Error: Could not write to log file: $file");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
fputs($fd, $string . "\n");
|
||||
fclose($fd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user