Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
System.php
Go to the documentation of this file.
1 <?php
8 
10 use Monolog\Logger;
11 
12 class System extends Base
13 {
17  protected $fileName = '/var/log/system.log';
18 
23 
27  protected $exceptionHandler;
28 
34  public function __construct(
37  $filePath = null
38  ) {
39  $this->exceptionHandler = $exceptionHandler;
40  parent::__construct($filesystem, $filePath);
41  }
42 
49  public function write(array $record)
50  {
51  if (isset($record['context']['exception'])) {
52  $this->exceptionHandler->handle($record);
53 
54  return;
55  }
56 
57  $record['formatted'] = $this->getFormatter()->format($record);
58 
59  parent::write($record);
60  }
61 }
__construct(DriverInterface $filesystem, Exception $exceptionHandler, $filePath=null)
Definition: System.php:34