File tree 3 files changed +39
-2
lines changed
src/Symfony/Bundle/FrameworkBundle
DependencyInjection/Compiler
3 files changed +39
-2
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <[email protected] >
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ namespace Symfony \Bundle \FrameworkBundle \DependencyInjection \Compiler ;
13
+
14
+ use Symfony \Component \DependencyInjection \Compiler \CompilerPassInterface ;
15
+ use Symfony \Component \DependencyInjection \ContainerBuilder ;
16
+ use Symfony \Component \DependencyInjection \Reference ;
17
+
18
+ class ErrorLoggerCompilerPass implements CompilerPassInterface
19
+ {
20
+ public function process (ContainerBuilder $ container )
21
+ {
22
+ if (!$ container ->hasDefinition ('debug.debug_handlers_listener ' )) {
23
+ return ;
24
+ }
25
+
26
+ $ definition = $ container ->getDefinition ('debug.error_handler_configurator ' );
27
+ if ($ container ->hasDefinition ('monolog.logger.php ' )) {
28
+ $ definition ->replaceArgument (1 , new Reference ('monolog.logger.php ' ));
29
+ }
30
+ if ($ container ->hasDefinition ('monolog.logger.deprecation ' )) {
31
+ $ definition ->replaceArgument (6 , new Reference ('monolog.logger.deprecation ' ));
32
+ }
33
+ }
34
+ }
Original file line number Diff line number Diff line change 17
17
use Symfony \Bundle \FrameworkBundle \DependencyInjection \Compiler \AssetsContextPass ;
18
18
use Symfony \Bundle \FrameworkBundle \DependencyInjection \Compiler \ContainerBuilderDebugDumpPass ;
19
19
use Symfony \Bundle \FrameworkBundle \DependencyInjection \Compiler \DataCollectorTranslatorPass ;
20
+ use Symfony \Bundle \FrameworkBundle \DependencyInjection \Compiler \ErrorLoggerCompilerPass ;
20
21
use Symfony \Bundle \FrameworkBundle \DependencyInjection \Compiler \LoggingTranslatorPass ;
21
22
use Symfony \Bundle \FrameworkBundle \DependencyInjection \Compiler \ProfilerPass ;
22
23
use Symfony \Bundle \FrameworkBundle \DependencyInjection \Compiler \RemoveUnusedSessionMarshallingHandlerPass ;
@@ -160,6 +161,8 @@ public function build(ContainerBuilder $container)
160
161
$ container ->addCompilerPass (new RegisterReverseContainerPass (false ), PassConfig::TYPE_AFTER_REMOVING );
161
162
$ container ->addCompilerPass (new RemoveUnusedSessionMarshallingHandlerPass ());
162
163
$ container ->addCompilerPass (new SessionPass ());
164
+ // must be registered after MonologBundle's LoggerChannelPass
165
+ $ container ->addCompilerPass (new ErrorLoggerCompilerPass (), PassConfig::TYPE_BEFORE_OPTIMIZATION , -32 );
163
166
164
167
if ($ container ->getParameter ('kernel.debug ' )) {
165
168
$ container ->addCompilerPass (new AddDebugLogProcessorPass (), PassConfig::TYPE_BEFORE_OPTIMIZATION , 2 );
Original file line number Diff line number Diff line change 21
21
->set ('debug.debug_handlers_listener ' , DebugHandlersListener::class)
22
22
->args ([
23
23
null , // Exception handler
24
- service ('monolog. logger.php ' )->nullOnInvalid (),
24
+ service ('logger ' )->nullOnInvalid (),
25
25
null , // Log levels map for enabled error levels
26
26
param ('debug.error_handler.throw_at ' ),
27
27
param ('kernel.debug ' ),
28
28
param ('kernel.debug ' ),
29
- service ('monolog. logger.deprecation ' )->nullOnInvalid (),
29
+ service ('logger ' )->nullOnInvalid (),
30
30
])
31
31
->tag ('kernel.event_subscriber ' )
32
32
->tag ('monolog.logger ' , ['channel ' => 'php ' ])
You can’t perform that action at this time.
0 commit comments