diff --git a/legacy/application/check.php b/legacy/application/check.php index 1e39b3ae6..1269109fd 100644 --- a/legacy/application/check.php +++ b/legacy/application/check.php @@ -88,7 +88,9 @@ function checkDatabaseConfiguration() // wrong, the database is improperly configured Propel::getConnection(); Propel::close(); - } catch (Exception $e) { + } catch (Exception $exc) { + Logging::error($exc->getMessage()); + return false; } @@ -112,15 +114,21 @@ function checkRMQConnection() { $config = Config::getConfig(); - $conn = new \PhpAmqpLib\Connection\AMQPStreamConnection( - $config['rabbitmq']['host'], - $config['rabbitmq']['port'], - $config['rabbitmq']['user'], - $config['rabbitmq']['password'], - $config['rabbitmq']['vhost'] - ); + try { + $conn = new \PhpAmqpLib\Connection\AMQPStreamConnection( + $config['rabbitmq']['host'], + $config['rabbitmq']['port'], + $config['rabbitmq']['user'], + $config['rabbitmq']['password'], + $config['rabbitmq']['vhost'] + ); - return isset($conn); + return isset($conn); + } catch (\PhpAmqpLib\Exception\AMQPRuntimeException $exc) { + Logging::error($exc->getMessage()); + + return false; + } } /** diff --git a/legacy/application/preload.php b/legacy/application/preload.php index 7e36bae90..5d27d80b6 100644 --- a/legacy/application/preload.php +++ b/legacy/application/preload.php @@ -5,3 +5,5 @@ require_once __DIR__ . '/configs/constants.php'; require_once VENDOR_PATH . '/autoload.php'; require_once CONFIG_PATH . '/conf.php'; + +Logging::setLogPath(LIBRETIME_LOG_FILEPATH);