Symfony 4:通过缓存清除在 PROD env 中出现独白错误

Symfony 4: Monolog error in PROD env via cache-clear

当我切换到 "PROD" env(在 .env 文件中)并清除缓存时,我收到 monolog 扩展名的错误:

Executing script cache:clear [KO] [KO] Script cache:clear returned with error code 1 !! !! In FileLoader.php line 168: !!
!! There is no extension able to load the configuration for "monolog" (in /Use !!
rs/antoinenedelec/Documents/symfony/boxbox/config/packages/monolog.yaml). L !! ooked for namespace "monolog", found "framework", "sensio_framework_extra", !! "twig", "security", "fos_user", "doctrine_cache", "doctrine", "doctrine_mi !! grations", "swiftmailer" in /Users/antoinenedelec/Documents/symfony/boxbox/ !! config/packages/monolog.yaml (which is loaded in resource "/Users/antoinene !!
delec/Documents/symfony/boxbox/config/packages/monolog.yaml").
!!
!! !! In YamlFileLoader.php line 657: !!
!! There is no extension able to load the configuration for "monolog" (in /Use !!
rs/antoinenedelec/Documents/symfony/boxbox/config/packages/monolog.yaml). L !! ooked for namespace "monolog", found "framework", "sensio_framework_extra", !! "twig", "security", "fos_user", "doctrine_cache", "doctrine", "doctrine_mi !! grations", "swiftmailer" !! !! !! Script @auto-scripts was called via post-update-cmd antoinenedelec@macbook-pro-de-antoine ~/Documents/symfony/boxbox$

我在 packagespackage/prod[= 中确实有一个 monolog.yaml 21=]。在 DEV 环境中一切正常。

使用 Symfony 4 & PHP 7.1.13

问题出在 "config/bundles.php"

=> 需要添加

  • 'prod' => 正确

在相应的包中。