diff --git a/src/pg/constants/Config.php b/src/pg/constants/Config.php index b748475..490e5ae 100755 --- a/src/pg/constants/Config.php +++ b/src/pg/constants/Config.php @@ -25,7 +25,7 @@ class Config /** * @var string */ - static $monologLogfile = PROJECT . '/logs/app.log'; + static $monologLogfile = null; /** * This holds unique uuid v4 diff --git a/src/pg/utils/LoggingUtil.php b/src/pg/utils/LoggingUtil.php index 9b26d4f..f1dbabd 100755 --- a/src/pg/utils/LoggingUtil.php +++ b/src/pg/utils/LoggingUtil.php @@ -40,6 +40,9 @@ protected function __construct() public static function addLog($severity, $className, $msg) { if (!isset(static::$logger)) { + if (!Config::$monologLogfile) { + throw new \Exception('Monolog log file not set'); + } static::$logger = new Logger(Config::$monologName); $stream = new StreamHandler(Config::$monologLogfile, Config::$monologLevel); $formatter = new LineFormatter(null, null, false, true);