File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 1111
1212namespace Symfony \Bundle \MonologBundle \DependencyInjection ;
1313
14+ use Monolog \Logger ;
1415use Monolog \Processor \ProcessorInterface ;
1516use Monolog \ResettableInterface ;
1617use Symfony \Bridge \Monolog \Handler \FingersCrossed \HttpCodeActivationStrategy ;
1718use Symfony \Bridge \Monolog \Processor \TokenProcessor ;
1819use Symfony \Bridge \Monolog \Processor \WebProcessor ;
20+ use Symfony \Bundle \FullStack ;
1921use Symfony \Component \HttpKernel \DependencyInjection \Extension ;
2022use Symfony \Component \DependencyInjection \Loader \XmlFileLoader ;
2123use Symfony \Component \DependencyInjection \ContainerBuilder ;
2224use Symfony \Component \Config \FileLocator ;
2325use Symfony \Component \DependencyInjection \Definition ;
2426use Symfony \Component \DependencyInjection \Reference ;
27+ use Symfony \Component \HttpKernel \Kernel ;
2528
2629/**
2730 * MonologExtension is an extension for the Monolog library.
@@ -48,6 +51,10 @@ private function levelToMonologConst($level)
4851 */
4952 public function load (array $ configs , ContainerBuilder $ container )
5053 {
54+ if (class_exists (FullStack::class) && Kernel::MAJOR_VERSION < 5 && Logger::API >= 2 ) {
55+ throw new \RuntimeException ('Symfony 5 is required for Monolog 2 support. Please downgrade Monolog to version 1. ' );
56+ }
57+
5158 $ configuration = $ this ->getConfiguration ($ configs , $ container );
5259 $ config = $ this ->processConfiguration ($ configuration , $ configs );
5360
Original file line number Diff line number Diff line change 2121 "symfony/dependency-injection" : " ~3.4.10 || ^4.0.10 || ^5.0" ,
2222 "symfony/config" : " ~3.4 || ~4.0 || ^5.0" ,
2323 "symfony/http-kernel" : " ~3.4 || ~4.0 || ^5.0" ,
24- "monolog/monolog" : " ~1.22"
24+ "monolog/monolog" : " ~1.22 || ~2.0 "
2525 },
2626 "require-dev" : {
2727 "symfony/yaml" : " ~3.4 || ~4.0 || ^5.0" ,
You can’t perform that action at this time.
0 commit comments