You are here

class IpProcessor in Monolog 8

Same name and namespace in other branches
  1. 2.x src/Logger/Processor/IpProcessor.php \Drupal\monolog\Logger\Processor\IpProcessor

Class IpProcessor

Hierarchy

Expanded class hierarchy of IpProcessor

1 string reference to 'IpProcessor'
monolog.services.yml in ./monolog.services.yml
monolog.services.yml
1 service uses IpProcessor
monolog.processor.ip in ./monolog.services.yml
Drupal\monolog\Logger\Processor\IpProcessor

File

src/Logger/Processor/IpProcessor.php, line 8

Namespace

Drupal\monolog\Logger\Processor
View source
class IpProcessor extends AbstractRequestProcessor {

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

}

Members