File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/Symfony/Bridge/Monolog/Handler Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,11 @@ public function close()
120
120
*/
121
121
public function onCommand (ConsoleCommandEvent $ event )
122
122
{
123
- $ this ->setOutput ($ event ->getOutput ());
123
+ if ($ event ->getOutput () instanceof ConsoleOutputInterface) {
124
+ $ this ->setOutput ($ event ->getOutput ()->getErrorOutput ());
125
+ } else {
126
+ $ this ->setOutput ($ event ->getOutput ());
127
+ }
124
128
}
125
129
126
130
/**
@@ -149,11 +153,7 @@ public static function getSubscribedEvents()
149
153
*/
150
154
protected function write (array $ record )
151
155
{
152
- if ($ record ['level ' ] >= Logger::ERROR && $ this ->output instanceof ConsoleOutputInterface) {
153
- $ this ->output ->getErrorOutput ()->write ((string ) $ record ['formatted ' ]);
154
- } else {
155
- $ this ->output ->write ((string ) $ record ['formatted ' ]);
156
- }
156
+ $ this ->output ->write ((string ) $ record ['formatted ' ]);
157
157
}
158
158
159
159
/**
You can’t perform that action at this time.
0 commit comments