Summary: Maintain a page log of wiki actions
Version: 2006-08-03
Status: Stable
Prerequisites: pmwiki-2.1.10
Maintainer: Dfaure
License: See terms in php file
Discussion: ActionLog-Talk
Users: +3 (View / Edit)

Question answered by this recipe

How can I keep a trace of all actions performed on the wiki pages?


This recipe will populate a Site.ActionLog? wiki page with a trace log of all the wiki activity.


Copy actionlog-2023-08-16.phpΔ to the cookbook directory (rename it) and add include_once("cookbook/actionlog.php"); to config.php.


The following configuration parameters would allow to fine tune the log behavior:

The trace page name (defaults to Site.ActionLog?).
Allows to ignore actions matching a given regular expression (defaults as undefined). For example, '/(browse|print)/' would disable logging of browsing or print previewing actions.
Selects whether or not the activity on the trace page itself is excluded (defaults to 1).
Selects whether log lines are appended or prepended to the trace page (defaults to false).
Defines the trace log line format. The string may be a combinaison of PHP's strftime formating parameters, PmWiki's pseudo-variables and specific tags. It defaults to the single line:

' %Y-%m-%d %H:%M:%S - REMOTE_ADDR - {$AuthId} - {$Author} - ACTION - [[TARGET]]'

is the address of the user.
is the interaction he had with...
the page concerned.
Sets the amount of last trace lines to keep (defaults as undefined).
When set to 1, allows a rotating action log of $ActionLogLinesMax depth to keep past events into backup pages (defaults as undefined).
The backup page name template. It defaults to '$ActionLogPageName-$Now' and may contain strftime formating parameters.
When set to 1, enables logging of followed external links.


  • The recipe script must be included after scripts/authuser.php or scripts/author.php to have the {$AuthId} and {$Author} wiki variables properly defined.
  • The standard wiki page modification notification system is disabled during ActionLog pages updates, and so shouldn't interfere with IMS caching.
  • For now, the external url tracking can't urls with parameters.


Releases Notes

  • 2005-08-26 Initial release.
  • 2006-03-22 Enhanced version. Updated licensing terms.
  • 2006-03-29 Updated to work after the page content has been sent to the browser (following Hagan's suggestion).
  • 2006-08-03 Heavily reworked. Added backup and preliminary url tracking.

See Also

Visitors Logging TotalCounter


See discussion at ActionLog-Talk

User notes +3: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.