This plugin is not maintained here anymore. Please check:
The logstats plugin provides a log file (NCSA combined i.e. like apache) of all access to dokuwiki pages. This way this file can be used to generate various statistics about the dokuwiki's usage.
A new plugin called statdisplay plugin is under development in order to compute statistics tables and bar graphs using the log file generated by logstats.
This plugin have been written using the information and code provided by Matthias Grimm at wiki:tips:logging
|Compatibility||wiki:dokuwiki 2007-06-26 and later|
- Log access into data/access.log
- Some IPs can be ignored
- Some users (logged) can be ignored
- Some bots can be ignored
This plugin have not been tested on website with high traffic. It may impact the performance of your dokuwiki because each hit creates a line of ~150 bytes in data/access.log. You've been warned.
Install it as a regular dokuwiki plugin. You can unzip it in the lib/plugins directory or deploy it using the plugin interface of dokuwiki.
When installed, it will create the file data/access.log. If this file cannot be created by apache, when displaying a page, dokuwiki will die with an error. You must chmod your data/ directory like this:
chmod uog+w data
If no error appears then you have successfully installed the logstats plugin ! You should find some logs into data/access.log like this:
18.104.22.168 - jf.lalande [01/Nov/2007:12:04:59 +0100] "GET ensib/home HTTP/1.1" 200 492 "home" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:22.214.171.124) Gecko/20070310 Iceweasel/126.96.36.199 (Debian-188.8.131.52-1)" 184.108.40.206 - jf.lalande [01/Nov/2007:12:26:16 +0100] "GET ensib/home HTTP/1.1" 200 492 "home" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:220.127.116.11) Gecko/20070310 Iceweasel/18.104.22.168 (Debian-22.214.171.124-1)"
The configuration of this plugin can be managed directly in dokuwiki (see Configuration link in admin interfarce).
You can change the filename of the log file using the $conf['plugin']['logstats']['accesslog'] variable:
$conf['plugin']['logstats']['accesslog'] = "data/other_access_file.log";
By default, if this variable is set to: data/access.log
You can ban som IP from beeing logged (for example your IP if you do not want to be consider as interesting web traffic). To do this, use the variable $conf['plugin']['logstats']['banned_ip'] which is a string containing all the banned ip, separated by a comma. Here is an example:
$conf['plugin']['logstats']['banned_ip'] = "127.0.0.1,192.168.0.1,192.168.0.2";
You can ban som users (logged into dokuwiki) from beeing logged. To do this, use the variable $conf['plugin']['logstats']['banned_users'] which is a string containing all the banned users, separated by a comma. Here is an example:
$conf['plugin']['logstats']['banned_users'] = "bob,alice,gugu";
You can ban som agents. It usefull for bots agents like google bot. To do this, use the variable $conf['plugin']['logstats']['banned_agents'] which is a string containing all the banned agent strings, separated by a comma. Here is an example:
$conf['plugin']['logstats']['banned_agents'] = "Googlebot,HooWWWer";
Make possible to log access hits into data/access.log Implement this into an action plugin. Give the possibility to ignore some IPs. Manage the plugin configuration via the admin interface.
- Check again the referrer detection. Maybe it's better to just put the referer without any detection.
- Give the possibility to ignore some IPs using regex.
- Generate html statistics with webalizer: if webalizer is installed, it would be great to generate the html files in a directory.
Generate statistics with a pure PHP analyzer: it seems that no pure-php script exists (I mean without perl, without mysql) to produce charts and statistics.see statdisplay plugin for this…
- 14/06/2008 logstats_1.4.tgz
- Frank Peters suggested me to add the possibility to ban agents. It is now possible using the configuration variable $conf['plugin']['logstats']['banned_agents'].
- 23/02/2008 logstats_1.3.tgz
- Jendrik suggested me to add the possibility to ban users. It is now possible using the configuration variable $conf['plugin']['logstats']['banned_users'].
- 02/11/2007 logstats_1.2.tgz
- I changed the configuration management. It is now configurable using the dokuwiki admin interface, as a regular plugin. Consequently, I had to rename the configuration option to $conf['plugin']['logstats']['accesslog'] and $conf['plugin']['logstats']['banned_ip'].
- 02/11/2007 logstats_1.1.tgz
- Bug fix: when using the admin plugin manager, the file conf/local.php is read and written. If using an array in this conf file, the line is not kept correctly. So I decided to change the variable $conf['logstats_banned_ip'] which not any more an array but now a string containing all the banned IP separated by comma.
- Improved HTTP referrer. It seems that Matthias have decided in his code to ignore referer that are not detected as a dokuwiki (i.e. he searched the regex “id=” in the referer). The referer (like google) was always empty. I changed this behavior: if no “id=” is detected, then I put the referer directly in the log.
- 01/11/2007 logstats_1.0.tgz
- Initial upload. Log access and avoid banned IP.
- J.-F. Lalande
- Matthias Grimm
- Frank Peters (for banned agents)
You can report bugs, wishes using our TRAC dokustats development platform.
Or you can post a comment here if you prefer:
Hello! This is a great plugin. I have been using it since many weeks now and it just does fine! My question is: Is there any way to exclude a user from being logged by his name? I know that ip's can be banned, but those change and the username does not. Thank you very much! Done :)
just a quick suggestion, your plugin should respect dokuwikis savedir setting..
Hello! This is a great plugin and it workes fine! My question: Is there any way to exclude a Range of IP's (e.g. 126.96.36.199 - 188.8.131.52 for Google.com is a commalist with ~8000 entries . Thank you very much! Frank I have added the function “Banned Agents”, its good for me. Frank
To be on the safe side, you should convert any occurrence of
” in the HTTP_USER_AGENT and REFERER to
\”. Otherwise any
” in either field will cause the analysis program to misinterpret the data.
There is a little bug in the logstat system, and this problem makes statdisplay doesn't working.
In the case of USER is space spaced (example “SURNAME Firstname”) the explode(” ”) function isn't right.
I correct the problem in logstats by adding following row in /logstats/action.php line 276
$user = str_replace(" ", "_", $user);
Great plugin. But there is another bug in it.
I moved my 'data' folder out of public area (for security reason). Now it's located in ”../data”. After installing this plugin a error meassage appears: The data folder is not writable. After recreating the data folder all works.