WebProcessor.php 646 B

12345678910111213141516171819202122232425262728
  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. class WebProcessor
  12. {
  13. public function __invoke($message, $handler)
  14. {
  15. $message['extra'] = array_merge(
  16. $message['extra'],
  17. array(
  18. 'url' => $_SERVER['REQUEST_URI'],
  19. 'ip' => $_SERVER['REMOTE_ADDR'],
  20. 'method' => $_SERVER['REQUEST_METHOD'],
  21. )
  22. );
  23. return $message;
  24. }
  25. }