You are here

RequestUriProcessor.php in Monolog 2.x

Same filename and directory in other branches
  1. 8 src/Logger/Processor/RequestUriProcessor.php

File

src/Logger/Processor/RequestUriProcessor.php
View source
<?php

namespace Drupal\monolog\Logger\Processor;


/**
 * Class RequestUriProcessor.php
 */
class RequestUriProcessor extends AbstractRequestProcessor {

  /**
   * @param array $record
   *
   * @return array
   */
  public function __invoke(array $record) {
    if ($request = $this
      ->getRequest()) {
      $record['extra']['request_uri'] = $request
        ->getUri();
    }
    return $record;
  }

}