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 11
11
12
12
namespace Symfony \Bundle \MonologBundle \DependencyInjection ;
13
13
14
+ use Monolog \Logger ;
14
15
use Monolog \Processor \ProcessorInterface ;
15
16
use Monolog \ResettableInterface ;
16
17
use Symfony \Bridge \Monolog \Handler \FingersCrossed \HttpCodeActivationStrategy ;
17
18
use Symfony \Bridge \Monolog \Processor \TokenProcessor ;
18
19
use Symfony \Bridge \Monolog \Processor \WebProcessor ;
20
+ use Symfony \Bundle \FullStack ;
19
21
use Symfony \Component \HttpKernel \DependencyInjection \Extension ;
20
22
use Symfony \Component \DependencyInjection \Loader \XmlFileLoader ;
21
23
use Symfony \Component \DependencyInjection \ContainerBuilder ;
22
24
use Symfony \Component \Config \FileLocator ;
23
25
use Symfony \Component \DependencyInjection \Definition ;
24
26
use Symfony \Component \DependencyInjection \Reference ;
27
+ use Symfony \Component \HttpKernel \Kernel ;
25
28
26
29
/**
27
30
* MonologExtension is an extension for the Monolog library.
@@ -48,6 +51,10 @@ private function levelToMonologConst($level)
48
51
*/
49
52
public function load (array $ configs , ContainerBuilder $ container )
50
53
{
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
+
51
58
$ configuration = $ this ->getConfiguration ($ configs , $ container );
52
59
$ config = $ this ->processConfiguration ($ configuration , $ configs );
53
60
Original file line number Diff line number Diff line change 21
21
"symfony/dependency-injection" : " ~3.4.10 || ^4.0.10 || ^5.0" ,
22
22
"symfony/config" : " ~3.4 || ~4.0 || ^5.0" ,
23
23
"symfony/http-kernel" : " ~3.4 || ~4.0 || ^5.0" ,
24
- "monolog/monolog" : " ~1.22"
24
+ "monolog/monolog" : " ~1.22 || ~2.0 "
25
25
},
26
26
"require-dev" : {
27
27
"symfony/yaml" : " ~3.4 || ~4.0 || ^5.0" ,
You can’t perform that action at this time.
0 commit comments