class CurrentUserProcessor in Monolog 8
Same name and namespace in other branches
- 2.x src/Logger/Processor/CurrentUserProcessor.php \Drupal\monolog\Logger\Processor\CurrentUserProcessor
Class UidProcessor
Hierarchy
- class \Drupal\monolog\Logger\Processor\CurrentUserProcessor
Expanded class hierarchy of CurrentUserProcessor
1 string reference to 'CurrentUserProcessor'
1 service uses CurrentUserProcessor
File
- src/
Logger/ Processor/ CurrentUserProcessor.php, line 10
Namespace
Drupal\monolog\Logger\ProcessorView source
class CurrentUserProcessor {
/**
* @var \Drupal\Core\Session\AccountProxyInterface
*/
protected $accountProxy;
/**
* @param \Drupal\Core\Session\AccountProxyInterface $account_proxy
*/
public function __construct(AccountProxyInterface $account_proxy) {
$this->accountProxy = $account_proxy;
}
/**
* @param array $record
*
* @return array
*/
public function __invoke(array $record) {
$record['extra']['uid'] = $this->accountProxy
->id();
$record['extra']['user'] = $this->accountProxy
->getAccountName();
return $record;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CurrentUserProcessor:: |
protected | property | ||
CurrentUserProcessor:: |
public | function | ||
CurrentUserProcessor:: |
public | function |