Create log file if it doesn't exist yet

This commit is contained in:
Miguel Nogueira 2020-12-27 19:28:48 +00:00
parent 33eb4021fa
commit 6ca471386d
Signed by: miguel456
GPG Key ID: 2CF61B825316C6A0
1 changed files with 5 additions and 0 deletions

View File

@ -14,6 +14,11 @@ $dotenv->required('CAT_API_KEY')->notEmpty();
define('PROJECT_ROOT', realpath(__DIR__ . '/../../'));
if (!file_exists(PROJECT_ROOT . 'Storage/Logs/bot.log'))
{
touch(PROJECT_ROOT . 'Storage/Logs/bot.log');
}
Analog::handler(File::init(PROJECT_ROOT . 'Storage/Logs/bot.log'));
Analog::info("Finished intializing configuration and dependencies.");