FileSystemHandler.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Refer to LICENSE.txt distributed with the Temando Shipping module for notice of license
  4. */
  5. namespace Temando\Shipping\Webservice\Logger\Handler;
  6. use Magento\Framework\Filesystem\DriverInterface;
  7. use Magento\Framework\Logger\Handler\Base as BaseHandler;
  8. use Temando\Shipping\Webservice\Logger\LogAnonymizerInterface;
  9. /**
  10. * Handler that logs to a separate file.
  11. *
  12. * @package Temando\Shipping\Webservice
  13. * @author Christoph Aßmann <christoph.assmann@netresearch.de>
  14. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  15. * @link http://www.temando.com/
  16. */
  17. class FileSystemHandler extends BaseHandler
  18. {
  19. /**
  20. * @param DriverInterface $filesystem
  21. * @param LogAnonymizerInterface $anonymizer
  22. * @param string $filePath
  23. */
  24. public function __construct(
  25. DriverInterface $filesystem,
  26. LogAnonymizerInterface $anonymizer,
  27. $filePath = null
  28. ) {
  29. $this->fileName = '/var/log/temando.log';
  30. parent::__construct($filesystem, $filePath);
  31. $this->bubble = false;
  32. $this->pushProcessor($anonymizer);
  33. }
  34. }