File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
lib/internal/Magento/Framework/Logger Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 9
9
10
10
use InvalidArgumentException ;
11
11
use Magento \Framework \Filesystem \DriverInterface ;
12
+ use Magento \Framework \ObjectManager \ResetAfterRequestInterface ;
12
13
use Monolog \Formatter \LineFormatter ;
13
14
use Monolog \Handler \StreamHandler ;
14
15
use Monolog \Logger ;
18
19
*
19
20
* @api
20
21
*/
21
- class Base extends StreamHandler
22
+ class Base extends StreamHandler implements ResetAfterRequestInterface
22
23
{
23
24
/**
24
25
* @var string
@@ -59,6 +60,14 @@ public function __construct(
59
60
$ this ->setFormatter (new LineFormatter (null , null , true ));
60
61
}
61
62
63
+ /**
64
+ * @inheritDoc
65
+ */
66
+ public function _resetState (): void
67
+ {
68
+ $ this ->close ();
69
+ }
70
+
62
71
/**
63
72
* Remove dots from file name
64
73
*
Original file line number Diff line number Diff line change 10
10
use Magento \Framework \Exception \FileSystemException ;
11
11
use Magento \Framework \Exception \RuntimeException ;
12
12
use Magento \Framework \ObjectManager \NoninterceptableInterface ;
13
+ use Magento \Framework \ObjectManager \ResetAfterRequestInterface ;
13
14
use Magento \Framework \ObjectManagerInterface ;
14
15
use Psr \Log \LoggerInterface ;
15
16
16
17
/**
17
18
* Create and use Logger implementation based on deployment configuration
18
19
*/
19
- class LoggerProxy implements LoggerInterface, NoninterceptableInterface
20
+ class LoggerProxy implements LoggerInterface, NoninterceptableInterface, ResetAfterRequestInterface
20
21
{
21
22
/**
22
23
* @var ObjectManagerInterface
23
24
*/
24
- private $ objectManager ;
25
+ private readonly ObjectManagerInterface $ objectManager ;
25
26
26
27
/**
27
- * @var LoggerInterface
28
+ * @var LoggerInterface|null
28
29
*/
29
30
private $ logger ;
30
31
@@ -39,6 +40,11 @@ public function __construct(
39
40
$ this ->objectManager = $ objectManager ;
40
41
}
41
42
43
+ public function _resetState (): void
44
+ {
45
+ $ this ->logger = null ;
46
+ }
47
+
42
48
/**
43
49
* Remove links to other objects.
44
50
*
You can’t perform that action at this time.
0 commit comments