class IpProcessor in Monolog 8
Same name and namespace in other branches
- 2.x src/Logger/Processor/IpProcessor.php \Drupal\monolog\Logger\Processor\IpProcessor
Class IpProcessor
Hierarchy
- class \Drupal\monolog\Logger\Processor\AbstractRequestProcessor
- class \Drupal\monolog\Logger\Processor\IpProcessor
Expanded class hierarchy of IpProcessor
1 string reference to 'IpProcessor'
1 service uses IpProcessor
File
- src/
Logger/ Processor/ IpProcessor.php, line 8
Namespace
Drupal\monolog\Logger\ProcessorView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AbstractRequestProcessor:: |
private | property | ||
AbstractRequestProcessor:: |
public | function | ||
AbstractRequestProcessor:: |
public | function | RequestProcessor constructor. | |
IpProcessor:: |
public | function |