Wiki source code of Statistics Parameters
Last modified by Eleni Cojocariu on 2026/09/16 11:37
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | The statistics parameters live in the "Statistics Plugin" section of ##xwiki/WEB-INF/xwiki.cfg##, where ##1## means true and ##0## means false. They are read at startup, so a change takes effect only on the next restart. | ||
| 2 | |||
| 3 | |=Parameter|=Default|=Shipped as|=What it does | ||
| 4 | |##xwiki.stats##|##1##|commented out|Turns the statistics module on or off for the whole instance: the storage thread and the page-view listener. | ||
| 5 | |##xwiki.stats.default##|##0##|##xwiki.stats.default=0##|Whether page views are stored for a wiki that does not define the ##statistics## field described below. Shipped as ##0##, which is why storage is off on a new instance. | ||
| 6 | |##xwiki.stats.request.excludedUsersAndGroups##|empty|commented out, without a value|The users and groups filtered out of the statistics a request displays. Their views are still stored. | ||
| 7 | |##xwiki.stats.storage.excludedUsersAndGroups##|empty|absent from the file|The users and groups whose views are never stored at all. | ||
| 8 | |##xwiki.stats.class##|##com.xpn.xwiki.stats.impl.XWikiStatsServiceImpl##|commented out|The implementation that records the statistics, for an instance that records them somewhere other than the XWiki database. | ||
| 9 | |||
| 10 | Three of them can be overridden per wiki, by a field of that wiki's ##XWiki.XWikiPreferences## object, which wins over the file whenever it is not empty: | ||
| 11 | |||
| 12 | |=Parameter|=Field of ##XWiki.XWikiPreferences## | ||
| 13 | |##xwiki.stats.default##|##statistics## | ||
| 14 | |##xwiki.stats.request.excludedUsersAndGroups##|##statistics_request_excludedUsersAndGroups## | ||
| 15 | |##xwiki.stats.storage.excludedUsersAndGroups##|##statistics_storage_excludedUsersAndGroups## | ||
| 16 | |||
| 17 | The ##statistics## field does not exist until you create it. See [[Enable Statistics for a Subwiki>>doc:documentation.xs.admin.statistics.enable-statistics-subwiki.WebHome]]. | ||
| 18 | |||
| 19 | Both lists are comma-separated, and an entity written without a wiki, such as ##XWiki.Admin##, means that user on the wiki being read, while ##xwiki:XWiki.Admin## means the one of the main wiki. A comma inside a name is escaped with a backslash. | ||
| 20 | |||
| 21 | This is how the two switches appear in the shipped file: | ||
| 22 | |||
| 23 | {{code language="none"}} | ||
| 24 | #-# Stats configuration allows to globally activate/deactivate stats module (launch storage thread, register events...). | ||
| 25 | #-# Enabled by default. | ||
| 26 | # xwiki.stats=1 | ||
| 27 | |||
| 28 | #-# When statistics are globally enabled, storage can be enabled/disabled by wiki using the XWikiPreference property | ||
| 29 | #-# "statistics". | ||
| 30 | #-# Note: Statistics are disabled by default for improved performances/space. | ||
| 31 | xwiki.stats.default=0 | ||
| 32 | {{/code}} | ||
| 33 | |||
| 34 | The shipped file also documents ##xwiki.stats.excludedUsersAndGroups## as the parameter that skips users "when storing statistics". That comment is wrong: the parameter has been deprecated since XWiki 2.5 and is only read as a fallback for the **request** filter. The storage filter is ##xwiki.stats.storage.excludedUsersAndGroups##, which the shipped file does not mention at all. |