Jump to content

Manual:Hooks/LogLine

From mediawiki.org
LogLine
Available from version 1.12.0
Processes a single log entry on Special:Log
Define function:
public static function onLogLine( $log_type, $log_action, $title, $paramArray, &$comment, &$revert, $time ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"LogLine": "MediaWiki\\Extension\\MyExtension\\Hooks::onLogLine"
	}
}
Called from: File(s): LogFormatter.php
Interface: LogLineHook.php

For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:LogLine extensions.

Details

[edit]
  • $log_type: string for the type of log entry (e.g. 'move'). Corresponds to logging.log_type database field.
  • $log_action: string for the type of log action (e.g. 'delete', 'block', 'create2'). Corresponds to logging.log_action database field.
  • $title: Title object that corresponds to logging.log_namespace and logging.log_title database fields.
  • $paramArray: Array of parameters that corresponds to logging.log_params field. Note that only $paramArray[0] appears to contain anything.
  • &$comment: string that corresponds to logging.log_comment database field, and which is displayed in the UI.
  • &$revert: string that is displayed in the UI, similar to $comment.
  • $time: timestamp of the log entry

Hint

[edit]

This hook does not get run when the log entry is of the types: move, block, protect, merge, delete, newusers.