ProcessIdProcessor.php 570 B

123456789101112131415161718192021222324252627
  1. <?php declare(strict_types=1);
  2. /*
  3. * This file is part of the Monolog package.
  4. *
  5. * (c) Jordi Boggiano <j.boggiano@seld.be>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Monolog\Processor;
  11. /**
  12. * Adds value of getmypid into records
  13. *
  14. * @author Andreas Hörnicke
  15. */
  16. class ProcessIdProcessor implements ProcessorInterface
  17. {
  18. public function __invoke(array $record): array
  19. {
  20. $record['extra']['process_id'] = getmypid();
  21. return $record;
  22. }
  23. }