ProcessIdProcessor.php 574 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  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
  17. {
  18. /**
  19. * @param array $record
  20. * @return array
  21. */
  22. public function __invoke(array $record)
  23. {
  24. $record['extra']['process_id'] = getmypid();
  25. return $record;
  26. }
  27. }