Manual:Hooks/GetSecurityLogContext
GetSecurityLogContext | |
---|---|
Available from version 1.45.0 (Gerrit change 1150677) Used to collect information about the request that's worth logging for log events which are relevant for security or anti-abuse purposes (login, credentials changes etc). | |
Define function: | public static function onGetSecurityLogContext( array $info, array &$context ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"GetSecurityLogContext": "MediaWiki\\Extension\\MyExtension\\Hooks::onGetSecurityLogContext"
}
}
|
Called from: | File(s): Request/WebRequest.phpCategory:MediaWiki hooks included in WebRequest.php#GetSecurityLogContext Function(s): getSecurityLogContext |
Interface: | GetSecurityLogContextHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:GetSecurityLogContext extensions.
Parameters
- array $info Information array with the following fields:
- request: the WebRequest object
- user: a UserIdentity object, or null. This is the user the log event is associated with (not necessarily the session user; not necessarily a locally existing user). The username is never an IP address.
- array &$context The PSR-3 log context.