From MediaWiki.org
Jump to: navigation, search

MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png

Release status:Extension status beta

ImplementationTemplate:Extension#type Special page, User activity
DescriptionTemplate:Extension#description Logs usage of the search box and allows reporting of keyword totals during given time periods
Author(s)Template:Extension#username Aran Dunkley (Nadtalk)
Latest versionTemplate:Extension#version 1.0.8 (2008-03-20)
MediaWikiTemplate:Extension#mediawiki 1.8.0-1.17.x
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license LGPL
Download OrganicDesign:Extension:SearchLog.php
  • $wgSearchLogPath
  • $wgSearchLogFile
  • $wgSearchLogEntireLog
  • $wgSearchLogDateFormat
  • $wgSearchLogReportHeading
  • $wgSearchLogGroup

Translate the SearchLog extension if it is available at translatewiki.net

Check usage and version matrix.

The SearchLog extension adds a new special page called Special:SearchLog which allows you to select a period to generate a table of search phrases and their usage count.


First create a directory called SearchLog in your wiki's extensions directory. Then, copy the searchlog source code from OrganicDesign:Extension:SearchLog.php and save it as a file called SearchLog.php into the newly created directory.

Add an include statement into your LocalSettings.php file to include the downloaded SearchLog.php file as usual, for example:


You need to create a subdirectory under;


called logs (the same as your $wgSearchLogPath) and make a file as specified in $wgSearchLogFile. The permissions should be set to chmod 755 on that file.

Configuration settings[edit]

Here are some global variables which affect the operation of the extension. These should be set in your LocalSettings file after the include of the SearchLog.php script.

Variable Default value Meaning
$wgSearchLogPath $IP/extensions/SearchLog/logs The directory into which the search logs will be placed
$wgSearchLogFile $wgSearchLogPath/search.log The name of the file to log the information to
$wgSearchLogDateFormat %b %Y The format of the dates displayed in the dropdown list (not the file)
$wgSearchLogGroup empty If set, restricts viewing of the special page to the specified group

Sortable Tables[edit]

I'll add some info about using sortable tables soon, until then see the talk page.


  • Fatal error: Call to a member function getID() on a non-object in SkinTemplate.php on 1.6.x and 1.7.x (the object in question is $wgArticle, tried setting it to an article if not already set, but that didn't work)

Change log[edit]

  • Version 1.0.8 (2008-3-20): Fixed summing and added links to searched items
  • Version 1.0.7 (2008-8-2): added Display raw unicode checkbox
  • Version 1.0.6 (2007-12-09): fixed "no such index" bug
  • Version 1.0.3: made compatible with improved search-form used in Extension:Simple Forms example