diff --git a/upgrades/8.1/scripts/BeforeUpgrade.php b/upgrades/8.1/scripts/BeforeUpgrade.php new file mode 100644 index 0000000000..a8e9180bdb --- /dev/null +++ b/upgrades/8.1/scripts/BeforeUpgrade.php @@ -0,0 +1,62 @@ +checkLogHandlers($container); + } + + /** + * @throws Error + */ + private function checkLogHandlers(Container $container): void + { + $config = $container->getByClass(Config::class); + + if (!$config->get('logger.handlerList')) { + return; + } + + $msg = "You need to remove logger.handlerList from the `data/config-internal.php` before upgrading. " . + "In EspoCRM v8.1, Monolog library was updated, custom log handlers may be incompatible. ". + "You will be able to return the handlers back after the upgrade."; + + throw new Error($msg); + } +}