====== Log Statistics Plugin ====== ---- plugin ---- description: This plugin provides a log file (NCSA combined i.e. like Apache) of all access to DokuWiki pages author : Andreas Gohr email : dokuwiki@cosmocode.de type : action lastupdate : 2016-07-06 compatible : Binky, Angua, Adora Belle, Detritus, Elenor of Tsort, Greebo, Igor depends : conflicts : similar : statistics tags : logging, statistics downloadurl: https://github.com/cosmocode/dokuwiki-plugin-logstats/zipball/master bugtracker : https://github.com/cosmocode/dokuwiki-plugin-logstats/issues sourcerepo : https://github.com/cosmocode/dokuwiki-plugin-logstats/ donationurl: ---- This plugin was initially written by [[jean-francois.lalande@ensi-bourges.fr|Jean-François Lalande]] based on some [[tips:logging|code]] by Matthias Grimm. The logstats plugin provides a log file (NCSA combined i.e. like apache) of all accesses to DokuWiki pages and media files. This way this file can be used to generate various statistics about the dokuwiki's usage. The logfile can be analyzed using popular web analytics software or within DokuWiki through the [[plugin:statdisplay|statdisplay plugin]]. [[https://www.cosmocode.de/en/open-source/dokuwiki-plugins/|{{ https://www.cosmocode.de/static/img/dokuwiki/dwplugins.png?recache|A CosmoCode Plugin}}]] ===== Installation ===== Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually. ==== Changes ==== {{rss>https://github.com/cosmocode/dokuwiki-plugin-logstats/commits/master.atom date}} ===== Configuration and Settings ===== The configuration of this plugin can be managed directly in DokuWiki (see Configuration link in admin interface).\\ For others parameters edit the file lib/plugins/logstats/conf/dafault.php ==== Log File Location ==== You can change the filename of the log file using the ''$conf['plugin']['logstats']['accesslog']'' variable. When a relative file name is given (which is by default), it is relative to the ''data/meta/'' directory. $conf['plugin']['logstats']['accesslog'] = "access.log"; ==== Banned IPs ==== You can ban some IP from being logged (for example your own IP). To do this, use the variable ''$conf['plugin']['logstats']['banned_ip']'' which is a string containing all the banned IP addresses, separated by a comma. $conf['plugin']['logstats']['banned_ip'] = "127.0.0.1,192.168.0.1,192.168.0.2"; ==== Banned Users ==== You can ban some users (logged into DokuWiki) from being 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. $conf['plugin']['logstats']['banned_users'] = "bob,alice,gugu"; ==== Banned User Agents (for bots) ==== You can ban some user agents. It useful 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. $conf['plugin']['logstats']['banned_agents'] = "Googlebot,HooWWWer"; ===== Known Limitations ===== Unlike your webserver, this plugin will not log any accesses to DokuWiki's own files (CSS, images, scripts, etc). Only content, that means wiki pages and media files are logged. Logging might have some slight impact on the performance as each request will create a disk write. ==== Problem when log file increases above 64 MB: ==== If the size to access.log file is bigger than 64 MB, the following message was printed in the server log and dokuwiki was out of service: FastCGI: "...doku.php" aborted: incomplete headers (0 bytes) received from server after 4 sec My dokuwiki is hosted by strato ("PowerWeb Basic" Packet). I have no chance to change anything in the php configuration. I've spent a lot of time trying to figure out what the problem was. It would be nice to have a better error indication, or even better, to add a file limitation field to the plugin configuration and to archive the file once the size limit is reached. ===== Suggestions ===== Is it possible to perform the tool with annual logs file ? eg. $conf['plugin']['logstats']['accesslog'] = "access.log"; could create ''2014.access.log'' if the current year is 2014, ''2015.access.log'' if the current year is 2015