add file system class for missing file/dir creation with writability exception
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
namespace Bsr\Utils\Logger;
|
||||
|
||||
use Bsr\Utils\Configuration\Configuration;
|
||||
use Bsr\Utils\FileSystem\FileSystem;
|
||||
|
||||
class Logger {
|
||||
|
||||
@@ -158,12 +159,7 @@ class Logger {
|
||||
{
|
||||
$mostRecentLogFileName = Configuration::get('log.file');
|
||||
|
||||
if (!file_exists($mostRecentLogFileName)) {
|
||||
if (!is_dir(dirname($mostRecentLogFileName))) {
|
||||
mkdir(dirname($mostRecentLogFileName), 0777, true);
|
||||
}
|
||||
touch($mostRecentLogFileName);
|
||||
}
|
||||
FileSystem::createFileOrDirIfNotExists($mostRecentLogFileName, true);
|
||||
|
||||
if(self::isMostRecentLogFileFromYesterday()) {
|
||||
self::makeRoomForNewLogFile($mostRecentLogFileName);
|
||||
|
||||
Reference in New Issue
Block a user