Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
851B

  1. <?php
  2. namespace Friendica\App;
  3. use Monolog\Processor\ProcessorInterface;
  4. /**
  5. * Includes the Friendica specific process_id of "app->process_id"
  6. *
  7. * @package Friendica\App
  8. */
  9. class FriendicaLoggerProcessor implements ProcessorInterface
  10. {
  11. /**
  12. * @var string the ID of the current Friendica process
  13. */
  14. private $processId = null;
  15. /**
  16. * Set the process id based on the Application instance
  17. *
  18. * @param string $processId the process id
  19. */
  20. public function setProcessId($processId)
  21. {
  22. if (!isset($this->processId) || $this->processId == '')
  23. {
  24. $this->processId = $processId;
  25. }
  26. }
  27. public function __construct()
  28. {
  29. $this->processId = session_id();
  30. }
  31. public function __invoke(array $records)
  32. {
  33. $records['extra'] = array_merge(
  34. $records['extra'],
  35. [
  36. 'app_id' => $this->processId,
  37. ]
  38. );
  39. return $records;
  40. }
  41. }